Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Userforms - Removing HTML Fields From Email


Reply

14 Posts   1380 Views

Avatar
Willr

1 December 2011 at 5:13pm Forum Moderator, 5511 Posts

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.

Avatar
Liam

1 December 2011 at 5:38pm Community Member, 470 Posts

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.

Avatar
Willr

1 December 2011 at 5:45pm Forum Moderator, 5511 Posts

Sorry, missed the multiple keyword in your post, no you can't set custom templates on each individual form in the module.

Avatar
Liam

1 December 2011 at 5:56pm Community Member, 470 Posts

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.

Avatar
Liam

29 September 2012 at 8:27am Community Member, 470 Posts

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 %>

Avatar
Liam

30 September 2012 at 2:13pm Community Member, 470 Posts

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.