Include receipant address as a variable
I send out a monthly newsletter via MM. To keep traffic smaller the email has a link to the PDF of the newsletter. I need to somehow include a variable (the To: email) as part of the link. ie href = thewebsite/nl.pdf?tomjones@email.com That way I can tell A) who is reading the NL and B) popup a notice: Your membership dues have been paid through 2023.
Google hasn't been any help - although I'll keep searching. Thanks for any help
On 6/3/22 20:23, chucka@blackforest-co.com wrote:
I send out a monthly newsletter via MM. To keep traffic smaller the email has a link to the PDF of the newsletter. I need to somehow include a variable (the To: email) as part of the link. ie href = thewebsite/nl.pdf?tomjones@email.com That way I can tell A) who is reading the NL and B) popup a notice: Your membership dues have been paid through 2023.
You can do this with a custom template for list:member:regular:header or list:member:regular:footer. See https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/t...
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thanks for the quick reply - I'm going to need a bit of schooling. I've looked at the page you point to and ... I'm lost - do I need to create a NL template? Can you give an example? < a href=https://mysite.com/my.pdf? > CLICK HERE ...
And I'm sure it will be "Ah, duh..." but right now...
On 6/4/22 09:22, chucka@blackforest-co.com wrote:
Thanks for the quick reply - I'm going to need a bit of schooling. I've looked at the page you point to and ... I'm lost - do I need to create a NL template? Can you give an example? < a href=https://mysite.com/my.pdf? > CLICK HERE ...
The bad news is list headers and footers are plain text so HTML tags don't work. The good news is that many if not most MUAs will render things that look like URLs as clickable links.
So, if you create a list:member:regular:header or list:member:regular:footer footer template that contains a line like
Go to https://mysite.com/my.pdf?$user_email to ...
That will replace the $use_email part with the recipient's lower cased
email address. If you want the case-preserved email address, use
$user_delivered_to
instead of $user_email
.
For this to work, the list's Settings -> Alter Messages -> Personalize
setting must be individualize
or full
.
Also see https://wiki.list.org/x/4030707 for some caveats.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
No joy. I'm hosted on Dreamhost and I think they run MM2 (maybe 1?) I can get the header to show up in the email, however Warning: The following illegal substitution variables were found in the msg_header string: user_email In the header I have https://mysite/NL.php - works https...php?xyz - works https...php?$user_email - kicks back to ?%(user_email)s - and gives the Warning - ...pdf.php?%(user_delivered_to)s
OH OH OH user_delivered_to works WOOP! WOOP! WOOP!
On 6/5/22 07:57, chucka@blackforest-co.com wrote:
No joy. I'm hosted on Dreamhost and I think they run MM2 (maybe 1?) I can get the header to show up in the email, however Warning: The following illegal substitution variables were found in the msg_header string: user_email In the header I have https://mysite/NL.php - works https...php?xyz - works https...php?$user_email - kicks back to ?%(user_email)s - and gives the Warning - ...pdf.php?%(user_delivered_to)s
OH OH OH user_delivered_to works WOOP! WOOP! WOOP!
Dreamhost's Mailman is 2.1 and the appropriate list for Mailman 2.1 is mailman-users@python.org <https://mail.python.org/mailman3/lists/mailman-users.python.org/>. Had you posted there in the first place, I would have known you were dealing with Mailman 2.1 and I would have been able to answer with Mailman 2.1 information.
In any case, it seems you've worked it out so that's good.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Sorry bout that - V2
I'm going back to MM because Dreamhost says I can only send 100 emails per hour - so... select id from mysql -> split -n75 -> send xaa -> at 65m send xa? -> repeat at 65m - and with that (this month) Gmail says I'm spamming and I never liked the send 75 every hour - so ... master DB is mysql and I can sync with MM with curl https://list.mylist?del/add... as people come and go.
Would be nice if DH would upgrade to V3 and go sql where I could have 1 DB with name, address, email, dues, hc/em, phone -
But, hey - I owes ya a beer. Thanks
[SOLVED]
My hosting company runs MM.2. I host a website for a local org and we send out a monthly newsletter via email. I use Mariadb/Mysql to keep track of members, dues paid, etc. But because MM.2 doesn't be sql... - workaround(s)
A) Mariadb DB and a webpage that looks like a spreadsheet. Click on member ID and up pops a edit window: fname, lname, address, dues(paid thru)... - add new member etc.
B) MM list.
a. lets.sync.php that: exec ("curl -s 'http://lists.ourorg.org/roster.cgi/newsletter-ourorg.org?roster-pw=12345678&roster-email=me@ourorg.org' | sort", $data);
foreach ($data as $d) extract all the emails - hint: look for "options.cgi" and add to array mm
b. select email from memberlist where dues >= 2021 to array db
Then I have to go both ways: foreach ($db as $mem) { if ( ! in_array ( $item, $mm) curl_it ("add", "$mem") }
and foreach ( $mm ... curl_it "del", "$mem"
C) function curl_it ($ad, $mem) { $H="http://lists.ourorg.org/admin.cgi/newsletter-ourorg.org/members"
switch ($ad) case add: $URL = "$H/add?subscribees=$em&adminpw=12345678"; break; case del: $URL = "$H/remove?unsubscribees=$em&adminpw=12345678"; break;
$ch = curl_init("$URL");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Shhhh!
$output = curl_exec($ch);
curl_close($ch);
}
Hope this helps someone else.
participants (2)
-
chucka@blackforest-co.com
-
Mark Sapiro