EOT Renewal / Reminder Isn't Sent when Processing s2member auto eot system via cron

Hi! When repeatedly using https://myurl/?s2member_auto_eot_system_via_cron=1 I can force wordpress/s2member to process all pending to expire users to be demoted.

They are demoted after I run it enough times, I receive the “(s2Member / API Notification Email) - EOT/Deletion” email but the subscribers do NOT receive their corresponding " EOT Renewal/Reminder Emails" at the same time.

Those messages are very important because they alert the user they lost privileges and, of course, are a strong incentive for them to subscribe again.

I’d appreciate if anybody knows if there’s another c - url that we can do to force those messages to be sent as well, since sometimes those warnings are sent a few hours later, but the “s2member_auto_eot_system_via_cron” doesn’t seem to include that routine.

I wonder if there’s a delay for those notifications, because they started being processed a few hours after their EOT, and only a few users every few minutes (irregular intervals).

I have changed the auto_eot “per process” to 50 (which helps with the EOT cron), but I feel it does not interfere with this other task, which must be triggered somewhere else. If I get a clear head soon I’ll try to look into the code again for clues, but I don’t program php yet, so I usually only hack existing code by making tiny modifications whenever possible :wink:

I wish there were more people acquiring the pro version of the plugin to help with its development. Sorry for not having enough technical knowledge to help better this far. Maybe in the future :innocent:

Thanks a lot no matter what, as usual.

Hi Sim.

Yeah, that’s a good improvement. Raise it to 100 or more, too, if your server can handle it. You can also raise the EOT reminders per process.

<?php
add_filter('ws_plugin__s2member_auto_eot_system_per_process', 's2_eots_per_process');
add_filter('ws_plugin__s2member_pro_eot_reminders_per_process', 's2_eots_per_process');
function s2_eots_per_process() {
   return 100;
}

See also this article: http://aaronjerad.com/blog/fix-s2member-eot-reminder-emails-not-sent/

I hope that helps! :slight_smile:

1 Like

Thanks a lot!

I had that done already (not as elegantly as in your example, which I will surely use instead of the code I currently have), but running the cron through that url doesn’t trigger it (it does trigger the EOT but not the pro messages).

Is there a different Curl I should use to trigger the pro_eot besides the auto_eot?

1 Like

No, that URL you posted is correct.

Did you use both filters in your code, or just one? You mentioned auto_eot_system_per_process, but not pro_eot_reminders_per_process.

In your log files, what do the EOT ones say? WP Admin > s2Member > Log Files

:slight_smile:

1 Like

The pro_eot_reminders_per_process were in the functionality.php (it’s the hack thing I use to add those pieces of code).

This is the code I had before:

// Increase per process SQL records scanned for EOT Reminder Emails

		add_filter ('ws_plugin__s2member_pro_eot_reminders_per_process', 'aamet_set_eot_per_process');
		
		function aamet_set_eot_per_process(){
			$per_process = 50;
			return $per_process;
			}

Just in case, I changed it to 200 and used your code now, we’ll see what happens :wink:

add_filter('ws_plugin__s2member_auto_eot_system_per_process', 's2_eots_per_process');
add_filter('ws_plugin__s2member_pro_eot_reminders_per_process', 's2_eots_per_process');
function s2_eots_per_process() {
return 200;
}
1 Like

Fingers crossed. :smiley:

1 Like

Where did you put that file? In /wp-content/mu-plugins/?

1 Like

No, I have a plugin called functionality, then I just edit the file functionality.php on the plugin editor. I set that thing up a long time ago, don’t remember exactly how :man_facepalming:t2:

I can see the code runs, though, since when I run the cron curl I get the 200 instead of the previous 50 and if I have the functionality.php disabled I go back to 6.

I feel that the auto_eot curl does what it says, it runs the auto_eot but not the pro_eot_reminders.

Gotcha. Thanks for the details.

What do the log files say?

1 Like

I didn’t check for this specific issue because the messages (I believe all of them, didn’t check one by one) end being sent at some point, but it usually takes several hours. I felt it was funny because I get the EOT emails right away but the messages to the users may take somewhere between one hour and one day after they already lost access.

I wish there was a way to have them notified right away instead, or to force everything to happen manually every now and then, because about once or twice a month I downgrade multiple users at once and it would be great if I could message all those EOT users right away, so they’d have at least an hour to contact me and pay again without losing some specific privileges I assign to them manually on my cloud storage. :innocent:

I see.

Well, now that you’re processing more at a time, you’re catching up, so your queue should be much shorter and quicker soon.

About demoting several at a time, you could use the user import to modify their EOT time to next day, instead of changing their role manually. If you just bulk change the role, the EOT handler doesn’t get triggered.

1 Like

Oh yes, I always set the EOT.

I usually set the EOT to 25 hours (it seems better to use any value above 24 hours from my experience, plus the user gets two warnings, one that their account will expire in less than 24 hours, a second that their account expired) but there was a new version of my content being released shortly after, so I had to set the EOT to a few dozen people to “now” instead, so the users that were late on their payments (or cancelled, I use other platforms like Patreon and I process those users manually, being Patreon usually once a month for 90% of the declines etc) would not have access to the new version without paying for it. :wink:

1 Like

Just found out something interesting! If the Paid Subscr. ID is empty (even if it’s a user we upgraded manually as a gift or because they paid us using a method that’s not managed by s2member) the Reminder Scan field is not populated, but it seems that the EOT is demoting the users, thankfully!

I felt it was worth mentioning, just in case the plugin is changed in the future, so the EOT doesn’t get broken in those cases for any reason.

Also, perhaps that’s the cause for the pro EOT reminders not being sent to some users? On the other hand, since we can set those messages to be sent after EOT, would that field interfere at all, considering the field is cleared up at EOT?

Anyway, I felt it was worth mentioning for reference. :wink:

Thanks again for everything and Happy New Year’s Eve!

:snowman::christmas_tree::calendar::fireworks::champagne::clinking_glasses::snowman: