strangerstudios / pmpro-sponsored-members

Generate a discount code for a main account holder to distribute to sponsored members.
https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
15 stars 27 forks source link

Adding a new template for sponsored emails #106

Closed swsjoshua closed 1 year ago

swsjoshua commented 2 years ago

Is your feature request related to a problem? Please describe. It is not easy to change the messaging being sent out to the sponsored purchases. There is no filter to change the message around the delivery of sponsored codes, and there is no way to style that content.

Describe the solution you'd like It would be nice to have an entire email template dedicated to sponsored levels being purchased. The email template could be changed via the email template editor for PMPro.

Describe alternatives you've considered I have tried modifying the code directly, but it's prone to being overwritten with updates. I have tried to do the entire function call in an override, but we run into issues with needing to update it in the future.

Additional context Custom email template to be able to swap out this content from the email: Email Template Text to change

andrewlimaza commented 2 years ago

You may use the filter, pmpro_email_data to add a custom message/variable such as !!sponsored_message_purchase!!.

Here's a code snippet that may be a good starting point - https://gist.github.com/strangerstudios/8585739

This will support updates as well without having to redo it. I do think this would be useful to have built in - I do not have a timeframe when this will be ready or released.

swsjoshua commented 2 years ago

That's actually a perfect solution to work with for now. Thank you so much for getting back to me!

JarrydLong commented 1 year ago

Closing this issue as a solution has been provided for it, thanks @andrewlimaza