I use an external email design tool to create responsive email notification messages. I have also configured a function to disable the normal editor in notifications by conditionally calling add_filter('user_can_richedit', '__return_false'); This keeps the regular editor from kindly rewriting my code.
However, whenever I save the notification GF is inserting a tag into the message “JAVASCRIPT HOOK FUNCTIONS FOR GRAVITY FORMS”
Obviously, I don’t need or want JS in the email. I’ve eliminated other plugins, and my own code I think. Any ideas on how to prevent this from being inserted?
I’m unable to replicate the issue described in a default WordPress installation with no other plugins active and using the default WP theme. Make sure that you’re using latest Gravity Forms version (2.9 currently).
It will allow you to perform the testing easily without affecting your visitors or doing permanent changes to the site. Note that for a valid conflict test, as the documentation explains the first try must be done with only Gravity Forms enabled, all other plugins disabled, and using a default WP theme without custom code (e.g. Twenty Twenty-One).
If I remove it, the script is not inserted but the visual editor messes up my email’s HTML.
Interestingly, it does not do this with just any plain HTML, just the code I build from MJML and import (responsive email layout.)
Doing a bit of exploration, I think the problem lays with GF’s Dom_Parser reading the notification HTML and determining that the script needs to be inserted into code – except that the insertion point is usually mid-body and not in the even.
Soo… is there a way to tell the DOM_Parser “hands-off” for notification email code??