Plantilla de correo electrónico de formularios de gravedad

I have a multisite with notifications that will send an email to the user once they completed a specific form. On avarage about 10 notifications per site (10 sites). So A LOT of notification emails.

I want to make a few small style changes to email notifications setup in gravity forms. Just font size, color and family. I know I can just do this with inline styling for every notification. But obviously I want to avoid this because its very time consuming.

At the moment the notification is just plain tekst, no custom styling whatsoever. The email must be build up somewhere so I've been looking through the plugin files to find the location but I am unable to find it.

Does anyone know where to find the email template? If I know where the email is being generated I can just wrap the email in a div and apply the styles there.

preguntado el 28 de mayo de 14 a las 12:05

Did you look in the plugin directory? -

Yea I did. I found a file called notification.php and it's probably being done there. But my php knowledge isn't advanced enough to figure out which part it is. Most of the functions there are for the backend from what I can tell. -

2 Respuestas

The development team do plan on making the output of merge tags such as the {all_fields} tag templatable in a future version. It's currently generated by the get_submitted_fields function in common.php but I would strongly advise against editing plugin files as your changes will be lost during updates and you should always keep WordPress and plugins updated.

In Gravity Forms 1.8.6 they did add a couple of hooks for changing the colors:

- Added new filter "gform_email_background_color_label" to change the background color for the field label in the html email.
    add_filter("gform_email_background_color_label", "set_email_label_color", 10, 3);
    function set_email_label_color($color, $field, $lead){
        return "#CC99FF";
    }
- Added new filter "gform_email_background_color_data" to change the background color for the field data in the html email.
    add_filter("gform_email_background_color_data", "set_email_data_color", 10, 3);
    function set_email_data_color($color, $field, $lead){
        return "#CCCCFF";
    }

There is also the gform_merge_tag_filter hook which can be used to change the output generated by merge tags: http://www.gravityhelp.com/documentation/page/Gform_merge_tag_filter

contestado el 28 de mayo de 14 a las 14:05

I know this answer comes late, but this question still shows up in Google when searching for "gravity forms email template"...

WP HTML Mail, my plugin, supports GravityForms forms now and it is free.

https://wordpress.org/plugins/wp-html-mail/

respondido 01 mar '18, 16:03

FYI, you have to disclose your affiliation when mentioning your projects or products. Thanks! :) - deshacer

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.