Grace time not performing required function

Great! :slight_smile:

No, it’s actually from the one you suggest. See attached. This is what gets downloaded when I run the User/Member Exportation, not the advanced one.

Ah ok. Well, you can remove columns from that CSV file after you download it, no problem.

Thought about this some more. I still didn’t find how to have different reminder times depending on the level, but I did remember how you could change the content of those reminders based on the level…

The reminders can handle PHP, so you could add a conditional that gives one content or other to customize the message based on the current level of the user. See: WP Admin > s2Member Pro > PayPal Options > EOT Renewal/Reminder Emails > PHP Code (at the bottom)

So the number of reminders would be the same for both levels, and at the same times, but you could make them say different things depending on the level.

I hope that helps. :slight_smile:

I’m not a PHP programmer but are you saying that I could add this code directly into the EOT reminder email fields:

if ($role_before_demotion === 's2member_level2') {
	echo "this email content for members approaching their regular membership EOT"
	} elseif ($role_before_demotion === 's2member_level1') {
	echo "this email content for members approaching their Overdue EOT"
}

Yes, that can definitely be done, but there are dozens of complex looking columns of data to remove and I would not expect the client to have to, or even to be able to do this each time they wish to generate a report. So I was trying to think of a way to automate this process using an excel macro on the exported spreadsheet. I’ll research this unless you had other suggestions.

1 Like

Yes, you could use something close to that in your email message to customize it.

I’d start by trying what the configuration for new user emails says here: WP Admin > s2Member > General Options > Email Configuration > New User Email Messages > PHP Code

" PHP Code: It is also possible to use PHP tags—optional (for developers). If you use PHP tags, please run a test email with <?php print_r(get_defined_vars()); ?>. This will give you a full list of all PHP variables available to you in this email. The $user variable is the most important one. It’s an instance of the WP_User class (e.g., $user->ID, $user->has_cap(), etc). Please note that all Replacement Codes will be parsed first, and then any PHP tags that you’ve included. Also, please remember that emails are sent in plain text format."

Your conditional will probably be something like this (I haven’t tested it yet, though):

<?php
$user_access_level = c_ws_plugin__s2member_user_access::user_access_level($user);
if ($user_access_level == 's2member_level2') {
   echo 'This email message for members approaching their membership EOT.';
} elseif ($user_access_level == 's2member_level1') {
   echo 'This email message for members approaching their overdue EOT.';
}
?>

Hi Cristian,

Two questions. I want to make a donation as good faith for the assistance you have been giving me. Can you show me how this is best achieved.

Secondly I attempted to use PHP in the EOT reminder fields but when I tried to save them they reverted to the original content i.e. it did not save any of my input.
This is the content that I tried to add to the EOT Renewal/Reminder Subject field:

<?php
$user_access_level = c_ws_plugin__s2member_user_access::user_access_level($user);
if ($user_access_level == 's2member_level2') {
   echo 'Renewal Reminder - Account Expires today';
} elseif ($user_access_level == 's2member_level1') {
   echo 'Final Reminder - Account three months overdue';
}
?>

Then this is the content that I attempted to put in the EOT Renewal/Reminder Message field:

Greetings %%first_name%%,

<?php
$user_access_level = c_ws_plugin__s2member_user_access::user_access_level($user);
if ($user_access_level == 's2member_level2') {
   echo 'It is membership renewal time!
If you have setup an automatic recurring subscription then you can ignore this email!
Otherwise this is a reminder that your account access expires today!';
} elseif ($user_access_level == 's2member_level1') {
   echo 'This is your final reminder to renew your TSAA membership.
After today you will not receive any more reminder emails. Your current membership is now three months overdue.';
}
?>
Fees are $30 per year or $75 for 3 years.

Please log in if you'd like to renew at http://www.tourette.org.au/renewal

TSAA Committee Members are all volunteers working for your interest.
Please show your appreciation by renewing promptly.
Your ongoing support is vital to what we do.

The greater our membership the greater our voice for TS.

This email is auto-generated based on your subscription renewal date. If you have already responded and renewed your subscription please ignore this email.

Not being a PHP programmer I feel like I am flying blind a bit here.

I just tried it in my site and then yours (with the -1 day reminder), and it saved fine. Did you click the “Save All Changes” button at the bottom of the page after the changes?

I want to make a donation as good faith for the assistance you have been giving me. Can you show me how this is best achieved.

Thank you! LIke I said, you don’t have to, but I appreciate if you want to do it anyway. :slight_smile:

The PayPal address is paypal@wpsharks.com.

I had set the day reminder to be zero thinking that the reminder would go out on the day the renewal was actually due. It didn’t like the zero but it didn’t mind the ‘-1’. So I will now test this with a couple of dummy users.

By the way I transferred USD$100 to you for your assistance. You’ve really got me out of a difficult situation and I appreciate it. I also appreciate what you are doing in general to keep s2Member alive. I want a positive relationship with you in case I need to ask you something else!

In fact I do! I have just exported a list of users/members from s2Member on the draftsite and the export csv is significantly reduced from the one that gets exported from the live site. I’m including copies of both as attachments to this post and you will see that the draftsite csv has about 30 columns while the live site csv has nearly 150. This is the first time I have seen this difference and I wonder if it relates to anything you have adjusted. Does it make any sense to you?exports.zip (271.0 KB)

Could be because you probably have the live site’s export tool set to “advanced”, while I changed the draft one to the simpler version. This is what I meant before when I suggested not using the advanced one. Grace time not performing required function

I transferred USD$100 to you for your assistance. You’ve really got me out of a difficult situation and I appreciate it. I also appreciate what you are doing in general to keep s2Member alive. I want a positive relationship with you in case I need to ask you something else!

Thank you very much! :smiley:

I’m very glad I’m being of help. Do keep asking when you need something, I’ll keep trying my best.

You did suggest this before and somehow I must have thought you were referring to something else. My apologies. You are absolutely correct, I did have it set to Advanced. All good.
I’ve setup some test members to see if those EOT reminders get sent out as expected.

1 Like

Great! :smiley:

Let me know how it goes.

By the way, Don, if it’s not too much to ask for, it’d help us a lot if you left us a review over at WordPress. https://wordpress.org/support/plugin/s2member/reviews/?filter=5

Thank you! :smiley:

I will definitely leave a review, Cristian. Are you happy for me to say how personally helpful you have been? It might lead to lots more work for you!

I wonder if you have any more ideas for the EOT reminder emails. I set the reminder email to go out 1 day before EOT including our PHP code, and set two test users (drfingerless - current and inkysmudge - overdue) with EOTs of today. So I would have expected that the reminders would have been sent out by now. But nothing. Are you able to take a quick look at this setup to see if I have missed any important element in my testing?

1 Like

It’s your review, feel free to say whatever you want. And thank you! :smiley:

I set the reminder email to go out 1 day before EOT including our PHP code, and set two test users (drfingerless - current and inkysmudge - overdue) with EOTs of today. So I would have expected that the reminders would have been sent out by now. But nothing.

Okay… Well, if you have a reminder for the day before, set the EOT time at least a couple of days ahead. I don’t think if setting the EOT for tomorrow will cause the reminder for the day before to be sent. I doubt that past reminders would get sent, because imagine if there were a sequence of several days of emails (e.g. 2 weeks, 1 week, 3 days, 1 day) and you set the EOT for today, you wouldn’t want all those emails to get sent, only future ones would. I’m sure Jason would have done it that way.

Let me know how it goes, and if you need anything else. :slight_smile:

Yes I actually did this. On Feb 12 I set the EOTs to be Feb 14 so that the -1 would take place on the 13th. But it didn’t happen.

1 Like

I see…

And every other email from your site does go out, right? Did you check the spam folder, just in case?

I’ll see if I can test this myself later. Same login info, right? :slight_smile:

Well the site isn’t sending out any other emails because it is a staging site (has no need) but I can’t think of anything that would be preventing this.
Yes, I always check my spam folder several times a day.
Yes, same login as before. See you you can find out.

Gotcha.

I created a test account the other day, and now I’m giving it time to see if the reminder gets sent. If tomorrow I haven’t gotten it, then I’ll disable all other plugins in the dev installation, and try again.

Ok thanks for keeping me up to date. I’ll look forward to hearing what you find out.

1 Like

Any news, Cristian?