Well just like any other template in ss you can override it from your theme. Copy the file I linked you to themes/yourtheme/templates/email/* and edit as you wish!
No need to edit the module code for templates.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Well just like any other template in ss you can override it from your theme. Copy the file I linked you to themes/yourtheme/templates/email/* and edit as you wish!
No need to edit the module code for templates.
So are you saying if I created 3 forms with this module, I can create 3 different email templates for each one? What do I name them?
I'm seeing that each form is outputted with the same id of #Form_Form which is not unique.
Sorry, missed the multiple keyword in your post, no you can't set custom templates on each individual form in the module.
Ya didn't think so, but you got my hopes up a bit ;) Not a huge deal as the default is fine. My client had just wanted 1 form a bit tweaked, but it's nothing major anyway.
Thanks for the help though. The <% if FormattedValue %> worked perfectly for removing blank fields.
I upgraded the site to 3.0 and I'm not sure if something changed, or it never worked like this. I'm leaning towards something changing.
When fields are left blank, I don't want the $Title being included in the email, but they are.
My template and I have flush?=all
<% if HideFormData %>
<% else %>
<dl>
<% control Fields %>
<% if $FormattedValue %>
<dt><strong><% if Title %>$Title<% else %>$Name<% end_if %></strong></dt>
<dd style="margin: 4px 0 14px 0">$FormattedValue</dd>
<% end_if %>
<% end_control %>
</dl>
<% end_if %>
Figured it out.
My folder for the email templates didn't have the capital E. So it was 'email' instead of 'Email' in mysite/templates/
So the custom template I had setup wasn't overriding.
This worked in 2.4 but not 3 if it happens to anybody else.