View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007903||phpList 3 application||Subscribe Process||public||18-09-06 15:54||02-11-12 17:13|
|Target Version||Future developments||Fixed in Version|
|Summary||0007903: Solution: new subscriber gets last list email automatically|
|Description||Hi, here's a quick & dirty solution for the problem / feature request 'New subscriber automatically sent last list email'. Works great with one list, for more lists you have to rework the query (phplist 2.10.2):|
I use only one list, so I assume that the actual newsletter to send has the highest id in the table - ah, and it can only be a record, that has a embargo date in the past. If you use more lists in your phplist installation, then you have to refine the sql query. OK, let's start (we're working on the file /lists/index.php):
Search for line 501 ($res .= $html;) and insert after that the following six lines:
$job = Sql_Query("SELECT max(id) FROM $tables[message] WHERE embargo <= now()");
$nldata = Sql_Fetch_Array($job);
$result = Sql_Query("UPDATE $tables[message] SET status = \"submitted\" WHERE id = $nldata");
$success = Sql_Affected_Rows();
$res .= "You will revcieve in a few minutes a copy of our latest newsletter.
That's all. Every time a new user confirms his newsletter activation, the latest valid newsletter record is set to 'resend' (table phplist_message, field status = submitted).
The next time when your cron job processes the queue the latest newsletter will be sent out to new users.
|Additional Information||Posted already in the forum: http://forums.phplist.com/viewtopic.php?p=20220#20220|
|Tags||No tags attached.|