FW: A subscribe link
Hello Developers at Mailman
Thank you for your advice below, this solves my problem but also creates a new problem.
The mobility of %(user_delivered_to)s is the issue. Is there something like an msg_body, where you can compile the html letter and insert %(user_delivered_to)s. That would obv be perfect.
Right now I have the issue of the msg_footer being inserted as an attachment, but I have found a solution for that on the internet. MIMEDefang... you obv know what I am talking about.
Msg_header does not work in MS office, but that won't work either because it will be at the top of the emailer. See attachment.
Please let me know what you think.
Thanks in advance
-----Original Message----- From: Mark Sapiro [mailto:mark@msapiro.net] Sent: 15 July 2011 01:22 AM To: Clayton Brown Cc: mailman-developers@python.org Subject: Re: [Mailman-Developers] A subscribe link
On 7/14/2011 1:18 AM, Clayton Brown wrote:
Example: There must be a link on the cleansing email that looks like this: <a href='www.test.com/subscribe.php?id=recipient@test.co.za'>Opt In</a> It will be then easy for me to subscribe the recipient into a subscribe database and just create a list afterwards.
If the installation has set
OWNERS_CAN_ENABLE_PERSONALIZATION = Yes
in mm_cfg.py so that the 'personalize' settings appear on the list admin Non-digest options page and personalize is set to Yes, then either the replacement %(user_address)s or %(user_delivered_to)s can be used in either msg_header or msg_footer to receive either the user's lower-cased email address or case-preserved email address respectively.
Those replacements work only in msg_header and msg_footer. They don't work in the message body and they don't work in digests.
E.g. You could put
Opt-in <www.test.com/subscribe.php?id=%(user_delivered_to)s>
in msg_footer. This may or may not be rendered as an active link depending on the users MUA. You can't put an HTML tag in msg_header or msg_footer, because it will always be in a text/plain part of the message.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Clayton Brown wrote:
Thank you for your advice below, this solves my problem but also creates a new problem.
The mobility of %(user_delivered_to)s is the issue. Is there something like an msg_body, where you can compile the html letter and insert %(user_delivered_to)s. That would obv be perfect.
No. There is no existing mechanism in Mailman to add replacements or insert text into HTML message bodies/parts.
Right now I have the issue of the msg_footer being inserted as an attachment, but I have found a solution for that on the internet. MIMEDefang... you obv know what I am talking about.
Perhaps you have seen the FAQ at <http://wiki.list.org/x/84A9> and the information linked from that about using MIMEDefang.
Msg_header does not work in MS office, but that won't work either because it will be at the top of the emailer. See attachment.
And will have the same issues as the 'attached' footer or worse will be treated by the MUA as the message body with the true message body treated as an attachment.
Please let me know what you think.
If putting your link with replacements in msg_footer along with the MIMEDefang solution documented at <http://stuff.mit.edu/~jik/software/mailman_mimedefang/> works for you, then you have a solution. If not, there's not much else you can do without actually modifying the Mailman/Handlers/Decorate.py handler to modify the HTML message body per recipient.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
I understand your comments below and suspected such an answer.
Let me ask you this, you know what our needs are.
I we were to ask you to code/modify mailman to our needs, would you do this?
-----Original Message----- From: Mark Sapiro [mailto:mark@msapiro.net] Sent: 19 July 2011 02:01 AM To: Clayton Brown; mailman-developers@python.org Subject: Re: [Mailman-Developers] FW: A subscribe link
Clayton Brown wrote:
Thank you for your advice below, this solves my problem but also creates a new problem.
The mobility of %(user_delivered_to)s is the issue. Is there something like an msg_body, where you can compile the html letter and insert %(user_delivered_to)s. That would obv be perfect.
No. There is no existing mechanism in Mailman to add replacements or insert text into HTML message bodies/parts.
Right now I have the issue of the msg_footer being inserted as an attachment, but I have found a solution for that on the internet. MIMEDefang... you obv know what I am talking about.
Perhaps you have seen the FAQ at <http://wiki.list.org/x/84A9> and the information linked from that about using MIMEDefang.
Msg_header does not work in MS office, but that won't work either because it will be at the top of the emailer. See attachment.
And will have the same issues as the 'attached' footer or worse will be treated by the MUA as the message body with the true message body treated as an attachment.
Please let me know what you think.
If putting your link with replacements in msg_footer along with the MIMEDefang solution documented at <http://stuff.mit.edu/~jik/software/mailman_mimedefang/> works for you, then you have a solution. If not, there's not much else you can do without actually modifying the Mailman/Handlers/Decorate.py handler to modify the HTML message body per recipient.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Jul 19, 2011, at 08:42 AM, Clayton Brown wrote:
I understand your comments below and suspected such an answer.
Let me ask you this, you know what our needs are.
I we were to ask you to code/modify mailman to our needs, would you do this?
It's something that I think would be an interesting add-on for Mailman 3. The way I've rewritten the delivery modules, I think it wouldn't be too hard to add a mail-merge type functionality, as a subclass of IndividualDelivery. The tricky parts would be enabling it on specific mailing lists (as opposed to across the board), and defining a configuration that merges what Mailman knows about the user, with some external database of additional personalized data.
If you think you'd like to experiment with this, I'd be happy to flesh it out further.
-Barry
On 7/18/2011 11:42 PM, Clayton Brown wrote:
I understand your comments below and suspected such an answer.
Let me ask you this, you know what our needs are.
I we were to ask you to code/modify mailman to our needs, would you do this?
Attached is the file Decorate.patch. If you apply this patch to Mailman/Handlers/Decorate.py and restart Mailman, you can then do the following:
Create a file named 'body_template' in Mailman's lists/LISTNAME/ directory where LISTNAME is the name of a list that you want to add HTML text to. The contents of the 'body_template' file can contain the same replacements that can be used in msg_header or msg_footer. I.e. if and only if the list is personalized, you can use replacements like %(user_address)s and %(user_delivered_to)s.
The contents of the 'body_template' file should be valid HTML and probably should be a <div> ... </div> division. It should be us-ascii with non-ascii characters represented as HTML entities to avoid clashes with the character set of the message body. If you want a literal '%' character in the HTML, it must be doubled ('%%') in the 'body_template' file so as not to be misinterpreted as a replacement leadin.
The group of the 'body_template' file should be Mailman's group and the file group readable.
If you do that, the contents of the 'body_template' file with the replacements appropriately replaced will be appended to the first text/html part found in the message if there is one (or inserted in front of a </body> tag if any).
If the list has a msg_header or msg_footer, those will still be added to the message as separate MIME parts (unless the message is simple text/plain), so you probably want to empty those.
Note that depending on the original HTML, there is no guarantee that this division will be rendered appropriately at the end of the message just because it is added at the end of the HTML.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Barry Warsaw
-
Clayton Brown
-
Mark Sapiro