progressivetech / com.aghstrategies.petitionemail

an extension that will allow the sending of emails to legislators and newspapers
Other
0 stars 2 forks source link

Allow you to use a MessageTemplate to send the email that is sent when petition is signed #2

Closed mattwire closed 2 years ago

mattwire commented 2 years ago

The allows you to use a MessageTemplate to customise the email that is sent when the petition is signed. A sample message template is provided - "Sample Petition Email". It is populated using the following tokens:

{petitionemail.subject}
{petitionemail.message}
{petitionemail.senderIdentificationBlock}
jmcclelland commented 2 years ago

Thanks @mattwire - this looks great. I'm merging now. Is there a reason not to use the mgd file for the Message Template instead of an upgrade function? Unless there's a good reason to avoid it I will move the template to the mgd file so it's easier to maintain.

mattwire commented 2 years ago

@jmcclelland No reason for not using the mgd file. I saw some of the work you've done uses a lot of mgd functionality from API4 which I've not really experimented with much yet. The approach using tokens means in theory you can have a separate template for each petition if you like - so the one provided is just a sample of what can be done.