Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot test "Cancel On Next Payment Date" email templates #2980

Closed
3 tasks done
ipokkel opened this issue May 3, 2024 · 0 comments · Fixed by #2984
Closed
3 tasks done

Cannot test "Cancel On Next Payment Date" email templates #2980

ipokkel opened this issue May 3, 2024 · 0 comments · Fixed by #2984
Labels

Comments

@ipokkel
Copy link
Member

ipokkel commented May 3, 2024

Describe the bug
Testing emails for the "Cancel On Next Payment Date" user and admin email templates does not send a test email and returns a "Test email failed" notice.

Some observations from a preliminary debug:

  • function sendCancelOnNextPaymentDateEmail( $user, $level_id ): The level ID returned during testing was always the level with the highest ID value (the last level created).
  • This happens regardless if the administrator (tester) is a member of that level or not.
  • This happens regardless whether the level have or does not have an expiration period set or custom expiration date set via Set Expiration Date Add On.

It seems like the issue occurs at line 383 as no level is returned when running a send test: $level = pmpro_getSpecificMembershipLevelForUser( $user->ID, $level_id );

$level = pmpro_getSpecificMembershipLevelForUser( $user->ID, $level_id );
// Make sure that the level is now set to expire.
if ( empty( $level ) || empty( $level->enddate) ) {
return false;
}

To Reproduce
Steps to reproduce the behavior:

  1. Go to Memberships > Settings > Email Templates and select either the "Cancel On Next Payment Date" or "Cancel On Next Payment Date (admin)" email template.
  2. Click on "Save Template and Send Email"
  3. See error

Expected behavior
To be able to successfully send test emails for the "Cancel On Next Payment Date" or "Cancel On Next Payment Date (admin)" email templates.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

Paid Membership Pro 3.0.3
PHP 8.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants