• Resolved WebDevels

    (@webdevels)


    The plugin is inserting unwanted <br> tags into the emails, which is causing formatting problems. Specifically, when sending HTML emails, I am seeing double <br> tags, and even when switching to plain text emails, the <br> tags are still present.

    To investigate this, I looked into the plugin’s code and found that the issue seems to be occurring in the file “kp-gfsmtp-send-override.php”. On line 389, the original code is:

    $_message = ( ! empty( $_notice['message'] ) ) ? GFCommon::replace_variables( $_notice['message'], $_form, $_entry ) : '';
    

    I modified this line to directly use $_notice['message'] as follows:

    $_message = ( ! empty( $_notice['message'] ) ) ? $_notice['message'] : '';

    After making this change, the emails are formatted correctly without any unwanted <br> tags. However, I am concerned about the implications of this modification. It appears that bypassing the GFCommon::replace_variables() function resolves the issue with the <br> tags, but I am unsure if this is the best solution or if it could lead to other issues, especially considering future updates and the overall functionality of the plugin.

    Could you please provide some guidance on how to properly address this issue? Is there a recommended way to prevent these unwanted <br> tags from being inserted into emails, or is there a fix available for this problem?

    Thank you for your assistance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Kevin Pirnie

    (@kevp75)

    As you point out, the issue is not with this plugin, but rather with Gravity Forms inherent functionality.

    We cannot and will not correct this on our end, but we can point it out to the Gravity Forms team.

    Thanks

    Thread Starter WebDevels

    (@webdevels)

    I don’t know where to place this issue. It is a Gravity Forms function you’re using there, so it must be checked by them. On the other hand, if I disable “SMTP Settings for Gravity Forms”, I don’t have double line breaks.
    So, which one is the right place? ??

    Hi there!
    First thank you for this awesome Plugin, it really is a great help to avoid emails coming in spam folder.

    I must confirm what @webdevels mentions,
    – original Notifications generated by Gravity Forms, with just the content {all_fields} in the “Message” field do not have this problem
    – Notifications generated with this plugin on the top will add <br> before AND after each individual text line in each row.

    I tested it in a fresh new website with basically just gravity forms and this plugin, also activating and deactivating this plugin.

    Hope this helps!

    Plugin Author Kevin Pirnie

    (@kevp75)

    Please understand that removing the GFCommon::replace_variables function will disable any and all GravityForms placeholders in the email, so it will not be removed in this plugin.

    Thank you Kevin,

    Unfortunately I am not a developer, so I won’t play with the GFCommon::replace_variables() because I have no idea what it really does.

    But I can tell you I switched to another plugin (Easy WP SMTP), and this other plugin does NOT add the extra <br> before AND after each individual text line when sending the Gravity Forms notifications…

    Hope it helps!

    Plugin Author Kevin Pirnie

    (@kevp75)

    @mixali

    Aye, probably shouldn’t anyways, since it’s GravityForms functionality.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Issue with Unwanted Tags in Emails’ is closed to new replies.