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

BUG: Not adding reason for cancellation to cancel email when using localized email template #18

Open
ipokkel opened this issue Jan 4, 2021 · 1 comment

Comments

@ipokkel
Copy link
Member

ipokkel commented Jan 4, 2021

When cancelling a membership level the reason for cancellation is not included in the email template if the site language is set to any locale for which PMPro core has translated email templates available under languages/email/
as the text replacement code only checks for the default English string and not strings for other locales.

We should consider checking the string that the reason is added to for each locale for which a translated email template set is available.

Steps to reproduce:

  1. Set site language to French under Settings > General
  2. On the Membership Account page, select to cancel active membership.
  3. Fill in the reason for cancellation and submit.
  4. Check the "cancel" email sent to the user and site administrator.

Alternatives:
Can use a customization recipe that checks per language locale, e.g https://gist.github.com/ipokkel/f6a4e868919b038401d601bfc0e35c98

Admin Only:
Ticket - https://www.paidmembershipspro.com/forums/topic/reason-for-cancelling-addon/

@kimcoleman
Copy link
Member

It looks like there is code in the current version to find a "variable" like !!reason!! and replace that. I think this is the fall back if it can't find the string to append to.

$body = str_replace( '!!reason!!', $reason, $body );

I'm also doing a PR to add a new "template variable" !!reason_for_cancelling!! that people can use which adds this as a data value the correct way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants