HTML Email Template plugin shows markup in messages

The HTML Emails that are generated can show markup in them. I'm creating this thread in reference to a bug that was reported some time ago in another thread.

If the recipient's mail client is set to accept HTML email, the plugin works as expected, however, if the recipient's mail client is set to only accept plaintext (ie, non-HTML) email, then all the HTML markup will be rendered in the message as though it were text. To recreate: send yourself an email with the plugin, then view is as an HTML message (looks fine) then view it as a plaintext message (shows markup). This can be fixed in the send_mail() function.

Thanks.

  • Adam Czajczyk

    Hello John A,

    I hope you're well today and thank you for your post.

    I tested this on my setup by sending a test e-mail from HTML Email Templates plugin. Where the HTML format is accepted it displays fine but I also wasn't able to replicate the issue. In RoundCube set to "plain text view" e-mail only includes content and doesn't render markup, see screenshot please:

    I support however that it may be different with other mail clients. Can you tell me please what have you tested that with so I could check that again using the same/similar environment/setup?

    Best regards,
    Adam

  • John A.

    Thanks, Adam. It seems we were simultaneously posting...

    I made a mistake on where this error was coming from... it's actually the AutoMessage plugin that has the error. Sorry for the confusion – it was too late to change the title. The symptoms as noted above are the same.

    To recreate the issue, add a new User Level Message to the AutoMessage plugin – be sure to add some markup. Then process the job... The email that is sent does not generate the multipart message correctly (renders the markup as plaintext) even if the HTML Email Template plugin is installed.

    I named the correct function above (send_message()) but it would also probably apply to the send_unsubscribe() function, as well. These are located in class.user.php. I added code to fix this (at least in the send_message() function,) but the function is already much longer than it should be, so it needs some additional thought.

    Ideally, the AutoMessage plugin should strip markup if the HTML Email Templates plugin is not installed, but if it is installed, the markup should be encased in a multipart message to render correctly.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.