View Issue Details

IDProjectCategoryView StatusLast Update
0007903phpList 3 applicationSubscribe Processpublic02-11-12 17:13
Reporterfoxpower Assigned To 
Status newResolutionopen 
Product Version2.10.2 
Target VersionFuture developments 
Summary0007903: Solution: new subscriber gets last list email automatically
DescriptionHi, 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[0]");
  $success = Sql_Affected_Rows();
  if ($success)
    $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.

Greets, Foxpower$
Additional InformationPosted already in the forum:
TagsNo tags attached.


related to 0002705 closed PHPList v2.11 release 
has duplicate 0008824 resolvedmichiel old newsletter sending on suscription 


There are no notes attached to this issue.