HTML removed from email
-
In a form I have I include HTML line breaks <br> in the Value field, to improve the layout of the email notification which is sent. Now (21 august 2026) these no longer appear in the email. I last used the form a few weeks ago, so the change is pretty recent. Is anything known about this?
The page I need help with: [log in to see the link]
-
Hi @nl_derek
I hope you are doing well.
I could replicate the issue and will report to our developers.
Can you replace the br with
<p> </p>Let us know the result you get.
Best Regards
Patrick Freitas@patrick interesting idea, I tried it but I got the general error message (specified under Customize Submit Button). I shall try some other escape possibilities and report back.
@patrick I tried
\<br>12.Zonnepanelenand
%lt;br>13.Warmtebeeldcamerabut in both cases the attempted HTML was stripped out; the content of the email was
12.Zonnepanelen, 13.WarmtebeeldcameraNote: I had difficulty pasting those strings into the reply box; the
<br>became a line break and the>was translated into a>. I hope this message survives! (edit: it did!)-
This reply was modified 2 weeks ago by
NL_Derek.
Hello @nl_derek
I ran further tests on my lab site, if you add the HTML in the email code tab the line break won’t be removed. I tested with the latest version of Forminator.
This is exptected to automtilcy remove the HTML from visual tab.
Best Regards
Amin@amin Thanks for the suggestion; I tried it but it doesn’t work. It resulted in the inclusion of my field {html-1} in the email but the checkbox Values are still scrunched together in a comma-separated list.
Interestingly the HTML was correctly rendered in the email (it comprises “
<h3>Bestelling</h3><h4>Personalia</h4>“)But a typical Value is “
<br>03.Tochtstrips” which tells me (as webmaster) that the user has checked box #3 in that group, with subject “Tochtstrips”.Hello @nl_derek ,
I hope you are doing well, and thank you for the update.
I couldn’t replicate the issue on my lab site. I am using Forminator version 1.57.1. In my testing, the HTML field kept the <br> tag in the Email body.
Screenshot: https://prnt.sc/Fal8drQLcqMw
Please let us know which Email Client service/software you are using to receive emails.
Please export your form and share it using https://pastebin.com/
Please be sure to remove any sensitive information from the form export.Learn more: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export
Kind Regards,
Fida Al HasanI have exported the form to https://pastebin.com/L7wXNakL under user NL_Derek and title Forminator form.
A brief background: our group aims to make the inner city of Zwolle more climate-friendly and we have a giveaway action for small energy-saving items. This form allows residents of Zwolle to obtain such items gratis (hopefully they will then buy more and make their houses more energy-efficient).
The only required fields are name (Naam) and Email, and you must check the box “Ik woon in de binnenstad van Zwolle” (our offer only applies to residents).
The problem comes with the sections “Bestelling” (Order) and “En Verder…” (Additional requests) where the user may check several boxes. In the email sent to me as Admin the selections all appear on one line separated by commas; I want them on separate lines so that I can read and action them more easily. Therefore the “Value” field of each checkbox item begins with “<br>”.
Until the last release of Forminator this worked; now no more. Hopefully someone can find a workaround.
My suggestion to the Forminator team (if that is appropriate here) is to allow selection of the separator; perhaps a choice between newline and a character string (with default of comma to ensure back compatibility).
Hello @nl_derek,
Thank you for sharing the form export and further detailed information about the issue that you are facing.
I imported your form on my lab site and could replicate the issue you noticed with the checkbox fields when it comes to the email notifications. Further, I downgraded the Forminator version to v1.57 on my lab site and could check the email notifications where the
break tagthat you have added to the checkbox values is taking effect, whereas in the current version it seems to be ignored.I have escalated this further for the Forminator team to review and confirm about the expected behaviour in this case, I am also checking with them if there can be any workaround possible for this situation. We shall update you on this as soon as we have further updates from them.
Thank you for your feedback regarding improving the email notification template, the Forminator team is already working on improving it, however, I cannot confirm an exact ETA as to when it will be released. I will share the suggestion internally with the team.
You can also follow to our roadmap in case you wish to receive notifications when we release new updates, the same will also be included in our changelogs here https://wordpress.org/plugins/forminator/#developers
Kind Regards,
SaurabhHi @nl_derek ,
I hope you’re doing well.
We got an update from the team about a workaround, could you please add the following code as a mu-plugin to your site?
<?php add_filter( 'forminator_custom_form_mail_admin_message', 'wpmudev_break_checkbox_mail', 10, 3 ); function wpmudev_break_checkbox_mail( $message, $custom_form, $data ) { if ( 53944 !== intval( $custom_form->id ) ) { // Please change the form ID. return $message; } $checkbox_data = array(); foreach ( $data as $key => $value ) { if ( false !== strpos( $key, 'checkbox-' ) ) { $checkbox_data[] = forminator_replace_field_data( $custom_form, $key, $data ); } } if ( ! empty( $checkbox_data ) ) { foreach ( $checkbox_data as $chk => $chkv ) { $chkv = explode( ',', $chkv ); foreach ( $chkv as $k => $v ) { if ( false !== strpos( $message, $v ) ) { $message = str_replace( $v, '<br/>' . $v, $message ); } } } } return $message; }A mu-plugin is basically a PHP file in your wp-content/mu-plugins folder. If the mu-plugins folder doesn’t exist, you can create it.
The name of the file could be anything like forminator-fix.php, but it needs to end in .php
Here is also more info about mu-plugins: https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Please let us know if this helps.
Best Regards,
Williams ValerioHi @nl_derek ,
I’m sorry, as in my previous reply, I missed mentioning that there is a specific part of the code that you need to change, which is this specific part:
if ( 53944 !== intval( $custom_form->id ) ) { // Please change the form ID.The number there 53944, is the actual form ID, and you should replace it with the form where you want to apply the code. This ID number can be found in the shortcode of the form.
This can be obtained from the form itself by clicking on Copy shortcode: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#embedding-forms
I hope this helps, and please let us know if you need further assistance.
Best Regards,
Williams ValerioHallo @williams, thanks for your reaction; the plugin seems to work! I installed it on a test subdomain and no smoke came out, so I’ll add it to the main site as well.
Can I assume that I will be notified when the plugin is no longer necessary? And, in the meantime, can I treat it as any other plugin (I maintain a list of plugins in my site documentation).
Again thanks!
Hello @nl_derek,
I hope things are going well for you.
Can I assume that I will be notified when the plugin is no longer necessary?
Usually, with every plugin update, the site itself notifies you in the WordPress Admin Dashboard, and we make changes that are reflected on the changelog pages, as mentioned here: https://wordpress.org/support/topic/html-removed-from-email/#post-19003351. Our Roadmap page notifies you via email about exciting feature releases if you subscribe to it.
And, in the meantime, can I treat it as any other plugin (I maintain a list of plugins in my site documentation).
That is a script. When we want it running all the time, we add it as a (must-use) mu-plugin. Once the Forminator team releases a fix for it, you can remove the script from the site.
Please let us know if you need any further help.
–
Kind Regards,
Imran KhanThanks @imran and team!
-
This reply was modified 2 weeks ago by
You must be logged in to reply to this topic.