phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007903phplist applicationSubscribe Processpublic18-09-06 16:5402-11-12 17:13
Reporterfoxpower 
PrioritynormalSeverityfeatureReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version2.10.2 
Target VersionFutureDevelopmentsFixed in Version 
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:

Code:

  $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: http://forums.phplist.com/viewtopic.php?p=20220#20220 [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to 0002705closed PHPList v2.11 release 
has duplicate 0008824resolvedmichiel old newsletter sending on suscription 

-  Notes
There are no notes attached to this issue.


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker