verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
96 stars 72 forks source link

Update email template to use {{body}} rather than {{contentHtml}} #2140

Open anchovy opened 1 week ago

anchovy commented 1 week ago

What are you trying to do?

I'd light Formie to automatically pick up the native Craft email template if set and allow this to be used as a template in the 'Edit Notification' > 'Templates' tab without having it be explicitly set as a email template in the formie settings.

What's your proposed solution?

As part of this - update the contentHtml variable to use body in line with the craft email template. https://verbb.io/craft-plugins/formie/docs/template-guides/email-templates#available-template-variables vs https://craftcms.com/docs/5.x/system/mail.html#html-templat

I'm currently using the following to allow both craft and formie to use the same email template:

   {# body is craft default, contentHtml is formie default. #}
   {{body ?? contentHtml ?? ''}}

Additional context

No response