Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gmail conversation grouping (threads) causing HTML email format issues

I have an HTML email that I send to my users. It looks great in all major Web, Desktop, and Mobile clients even Gmail, EXCEPT when the email is included as part of a "conversation" in Gmail. In that case, some of the table background colors don't show, the text alignment is wrong, etc. Is there a way to prevent this?

like image 744
Justin Cloud Avatar asked Sep 02 '26 10:09

Justin Cloud


2 Answers

Make sure your messages have different subject lines, that'll prevent them from being in a conversation. Or, if just testing, leave the subject line blank.

like image 171
zazzyzeph Avatar answered Sep 04 '26 05:09

zazzyzeph


Tested answer: Change the sender of your email by inserting a random number. So instead of sending from [email protected], send from [email protected]. Functionally, these are the same email address (replying will send to the same person).

In ES5:

randomNumber = Math.floor(Math.random()*100).toString();
from = 'Foo <foo+' + randomNumber + '@bar.com>';

In ES6:

randomNumber = Math.floor(Math.random()*100);
from = `My Company <foo+${randomNumber}@bar.com>`;
like image 29
ginna Avatar answered Sep 04 '26 04:09

ginna



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!