PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Customizing HTML email template

  1. MiniMooCreative
    Member

    I want to use the nicely formatted email I get when using {all_fields}, but I need to remove some entries (e.g. I have a section titled 'Disclaimer' and it shows up in the email). Is there any XML/HTML/PHP template that I can copy and modify?

    Posted 8 years ago on Saturday February 19, 2011 | Permalink
  2. Currently no. The all_fields isn't configurable. It's a helper variable designed to make it easy to quickly output all of the submitted fields. There is no template because every form is different. It's dynamically created. All the all_fields variable does is loop through all the submitted form fields and outputs them in a table. There is nothing to configure or customize with it.

    You would have to format your own email using the form field variables rather than use the all_fields variable if you don't want to output everything.

    Posted 8 years ago on Saturday February 19, 2011 | Permalink
  3. rorybladen
    Member

    Hi,

    I've come over to Gravity forms after a lot of work customising my cforms installation. In cforms I got stuck on one crucial detail - i only want to display fields in the confirmation email IF they have a value.

    I have a list of hidden fields which are populated with POST variables from the previous page. If the hidden field gets a value of 5, I want it to display in the email - ie. Children = 5.

    but if the field value is 0, I don't want it to show up as Children = 0 instead just not send that row / field.

    Is there any way to do this in Gravity Forms?

    thanks.

    Posted 8 years ago on Wednesday March 9, 2011 | Permalink
  4. When using the {all_fields} merge code in your notification email to output all the field values in a nicely formatted table it does not return fields that were not filled out. It doesn't include empty values.

    However, 0 is not an empty value. 0 is a value. So if the field is populated with 0 it would be displayed. Instead of populating it with 0 you would have to populate it with nothing and leave it empty.

    Posted 8 years ago on Wednesday March 9, 2011 | Permalink
  5. rorybladen
    Member

    Hi Carl,

    Great, thanks for your quick reply. My mistake - yes the values would be empty not 0.

    IS there any way I can apply the same logic that {All_Fields} is using but with individual fields? - I want to format the email in a specific way.

    can you point me in the direction of the {All_Fields} function in the plugin editor so I can see how it works please.

    Posted 8 years ago on Wednesday March 9, 2011 | Permalink
  6. Individual fields won't output if they have a value. The problem is markup and hardcoded text around them in the Notification email will. So that can pose an issue. Currently there is no way around that. We plan on introducing a way to handle this in a future release either via some sort of custom conditional scripting you can apply, or by implementing "before" and "after" code attributes you can add to the field variables in the notification email.

    Posted 8 years ago on Wednesday March 9, 2011 | Permalink
  7. rorybladen
    Member

    Hi Carl,

    Ok thanks for your help. Yeah it would be great to be able to drop the field label into the email and send it only if the field value was being sent also.

    possibly just an alternative field tag that included the label so you had the option to add just the value {Email:4} like the current method, or a {label + value} ?

    Anyway I'm light years ahead of where I was by using the All_Fields option. I will just use the field/form order and css to get it closer to what I need.

    Thanks again for your help, the support is much appreciated.

    Posted 8 years ago on Wednesday March 9, 2011 | Permalink

This topic has been resolved and has been closed to new replies.