{Message} text not affected by surrounding HTML

Hey there :slight_smile:

I wonder why sometimes the {Message} text isn't styled by its surrounding CSS in my registration admin and client e-mails.

This is how my HTML e-Mail {Message} area looks like:

<p class="lead" style="margin: 0; padding: 0; font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 17px; font-weight: normal; line-height: 1.4;">{MESSAGE}</p>

Now look what appears Like on "image1". The text size should be 17px,

while an order (pro sites) e-mail which i created appears like "image2".

i have to say, that my pro-sites e-mail (manual payment) is created like this:

//php clientmailer variables
		$subject_client = "E-Mail Subject!";

		$headers_client = 'From: '. $to . "\r\n" . 'Reply-To: ' . $to . "\r\n";
			$headers_client .= "MIME-Version: 1.0\r\n";    //HTML declaration :)
			$headers_client .= "Content-Type: text/html;\r\n";     //HTML  declaration :)

			$mailtext_client = my Mailtext <br> which is HTML!

wp_mail($curr_user_email, $subject_client, $mailtext_client, $headers_client);

So my question is, how can i make the registration e-mails like on "image1" also to be affected by the surrounding HTML like my pro-sites e-mails mentioned above?

Automessage e-mails are also looking like on image1.
The e-mails sended by Pro-Sites (for example the expiration e-mail) looked totally weired.
There is only HTML to see. Please take a look at "image3" for this.

I hope i explained that good enough, if not please let me know! :slight_smile:

Best wishes,
David

  • Patrick

    Hi there @David

    I hope you're well today!

    The {MESSAGE} placeholder will be replaced in emails by all the email content, including paragraphs & headings. So if you wrap that in a p tag, your style rules will likely not be applied systematically if there are other p tags inside the MESSAGE body. I would recommend using a div instead which can accept nested p tags inside it.

    As for the Pro Site email, I can confirm that what is received is definitely not what is expected, lol. The 1st screenshot below shows the email I received with HTML Email Templates active; the 2nd shows the actual email contents when the "noname.html" file is viewed in a browser.

    I've flagged this as a bug and have alerted the plugin developer to the situation so he can investigate.

  • MapSteps

    Hey @Patrick,

    Of course! You are so right!
    This was wrapped in a Paragraph tag by default and i was thinking so complicated i didn't even take a look at the code :smiley: Thought it was a bigger thing i tried to solve everywhere else :smiley:

    I changed that p tag into a div, and et voilà: its looking like it should :slight_smile: Love it, Thanks for that!

    Thank you also for your reporting the bug! Would be great if this could be fixed, so i don't scare my customers :slight_smile:

    Have a great day, Patrick!
    Best wishes,
    Dave

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.