Please Note: We are no longer using forums to facilitate standard support. 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.

Plain Text Notifications Not Removing HTML Tags

  1. gajusbd
    Member

    Running the most current version of Gravity Forms and using the following to output email notifications in plain text:

    // Change ticket submission form notification email format
    add_filter("gform_notification_format_1", "text", 10, 4);

    Emails do come through in plain text however all the html tags are present throughout the email and look like the code below. Anyone know how to fix this???

    <tr>
    <td colspan="2" style="font-size:14px; font-weight:bold; background-color:#EEE; border-bottom:1px solid #DFDFDF; padding:7px 7px">Requestor Info</td>
    </tr><tr bgcolor="#EAF2FA">
    <td colspan="2">
    <font style="font-family: sans-serif; font-size:12px;">Name</font>
    </td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td width="20"> </td>
    <td>
    <font style="font-family: sans-serif; font-size:12px;">Name</font>
    </td>
    </tr><tr bgcolor="#EAF2FA">
    <td colspan="2">
    <font style="font-family: sans-serif; font-size:12px;">Username</font>
    </td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td width="20"> </td>
    <td>
    <font style="font-family: sans-serif; font-size:12px;">user</font>
    </td>
    </tr><tr bgcolor="#EAF2FA">
    <td colspan="2">
    <font style="font-family: sans-serif; font-size:12px;">Email</font>
    </td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td width="20"> </td>
    <td>
    <font style="font-family: sans-serif; font-size:12px;">email@gmail.com</font>
    </td>
    </tr><tr>

    Posted 3 years ago on Friday March 9, 2012 | Permalink
  2. You'll need to manually add your merge tags and format the message the way you want it in the notification settings. You're seeing that output because you're using the {all_fields} merge tag which uses pre-formatted HTML.

    The filter only sends the message in TXT mode, it doesn't strip HTML.

    Posted 3 years ago on Friday March 9, 2012 | Permalink
  3. gajusbd
    Member

    Awesome. Thanks Kevin. That works great.....all except for the ending br tag. Is there a way to remove that?

    Posted 3 years ago on Friday March 9, 2012 | Permalink
  4. Not sure about what that is offhand. Let me check it out and I'll let you know.

    Posted 3 years ago on Friday March 9, 2012 | Permalink

 

Support Tickets

Open A New Support Ticket
 Open A New Priority Support Ticket *

* Developer license holders only