back to phpList.org

[SOLVED] Autoresponder sending to old subscribers

Tags: #<Tag:0x00007fdc218bd468>

I’m using phpList 3.3.3. All plugins were updated to current version as of today, Sept 6, 2018.

I’ve installed the Autoresponder Plugin and it is working, but not quite right. Even though I’ve set it to only send to new subscribers, it’s sending to all subscribers. Right now I’m just working with a test list. Here’s my process:

  1. Importing users from a CSV file using the Subscribers Plugin commandline. Initial CSV has 2 subscribers. They are added to the test list and show the same, correct time for entered and last modified.
  2. Create Autoresponder with delay time of 1 minute. Verify that added time is after the first two subscribers entered time. As I monitor this Autoresponder, it shows 0 | 0 | 0 for Ready | Not Ready | Sent for several minutes after creation.
  3. Add one subscriber to the CSV file and import using the Subscribers plugin commandline. After the import, the Autoresponder shows 3 Not Ready. After one minute it shows 3 Ready. If I process the queue, all three messages are sent.
  4. Verify that only the third subscriber has an added date/time that falls after the creation of the Autoresponder.

I’m thinking that something about the command line import using the Subscribers plugin is not compatible with only sending to new subscribers. Another thing I’ve noticed is that the documentation of the Autoresponder plugin mentions that a new subscriber attribute will be created when you add the autoresponder. I’m not seeing that new attribute either in the attribute list or in an individual subscriber.

Finally, if I manually add a subscriber to the list, then everything operates as expected. Only 1 subscriber is Not Ready for one minute, then Ready.

Thanks for any suggestions on how to resolve this. I really need to have this all work in an automated fashion if possible.

@bhotrock I’ll try to repeat this problem later today.

Do you mean that you added one subscriber to the two that were already in the file, and therefore imported the first two subscribers for a second time?

Another thing I’ve noticed is that the documentation of the Autoresponder plugin mentions that a new subscriber attribute will be created when you add the autoresponder. I’m not seeing that new attribute either in the attribute list or in an individual subscriber.

That applies to the old versions of the plugin (version 2). There is a section on updating to version 3 that explains the attribute is no longer used, but maybe it is now time for me to remove any reference to the attribute.

Thanks Duncan!

Blockquote
Do you mean that you added one subscriber to the two that were already in the file, and therefore imported the first two subscribers for a second time?

Yes, the third user was added to the original file and then reimported. However, the “entered” time/date for the first two subscribers remain the same - prior to the autoresponder date/time.

I’m wanting to keep a single file that is repeatedly reimported via command line because attributes for each subscriber may change at any time. Reimporting the single file with updated attributes or added subscribers should keep everything up to date in phpList.

This autoresponder is designed to send a “welcome” email with specific subscriber details (attributes) to new subscribers. This “problem” is only going to be an issue at the beginning when I need to import about 1,400 existing subscribers into phpList and NOT send the welcome email. If there’s not a way around it, I can possibly change the content to something that would be okay to send to all existing subscribers, let the autoresponder send, and then change the content to be the actual welcome message. That way the original subscribers would be in the already sent list.

Blockquote
That applies to the old versions of the plugin (version 2). There is a section on updating to version 3 that explains the attribute is no longer used, but maybe it is now time for me to remove any reference to the attribute.

Ok, that makes sense. I skipped over the update from 2 to 3 section since I was starting with 3.

Thanks for your help!

@bhotrock The autoresponder plugin selects subscribers based on the time since they were added to a particular list (the list associated with the selected campaign), which can be different to the time since they initially subscribed.
So it uses the “modified” date on the listuser table, not the “entered” date on the user table.

The problem that you have is due to how the phplist import2 page deals with a subscriber who already belongs to the list. It does an sql REPLACE, which in effect deletes then adds again the subscriber to the list. That causes the subscriber to have a later modified date, which is detected by the autoresponder plugin.

You can change the import2 page to in effect ignore subscribers who already belong to the list by changing the sql statement. In phplist 3.3.3 for file admin/actions/import2.php change line 441 from
$query = 'replace INTO '.$tables['listuser']." (userid,listid,entered) values($userid,$listid,now())";

to
$query = 'insert ignore INTO '.$tables['listuser']." (userid,listid,entered) values($userid,$listid,now())";

This change tells mysql to ignore any error when inserting a record that already exists (user id and list id) in the listuser table.

2 Likes

Thank you Duncan! You are awesome!!!
Brad

I just finished making this modification and it worked perfect!! Thank you!

Is this something I will need to modify again after updates? If so, just when I update the Subscribers plugin, or phpList, or both?

Thanks again!

1 Like