diff --git a/src/assets/emails/genericTemplate.html b/src/assets/emails/genericTemplate.html index 9ea9190..0c5955f 100644 --- a/src/assets/emails/genericTemplate.html +++ b/src/assets/emails/genericTemplate.html @@ -53,7 +53,8 @@ color: #fff !important; font-weight: 700 !important; } - td strong { + td strong, + td b { font-weight: 700 !important; color: #9D6FF3 !important; } @@ -113,14 +114,10 @@ } } - td.primary a, - td.secondary a, - td.primary span, - td.secondary span, - u+.email-body td.primary a, - u+.email-body td.secondary a, - u+.email-body td.primary span, - u+.email-body td.secondary span { + td.button a, + td.button span, + u+.email-body td.button a, + u+.email-body td.button span { text-decoration: none !important; } diff --git a/src/mailer.ts b/src/mailer.ts index 4cdd85c..630c3e4 100644 --- a/src/mailer.ts +++ b/src/mailer.ts @@ -113,15 +113,20 @@ export class CreateEmail { }); } + // wrap and in a element, to fix color on thunderbird and weight on icloud mail web + const bRegex = /.*?<\/b>|.*?<\/strong>/g; + + if (!plainText) { + c.text = c.text.replace(bRegex, el => `${el}`); + } + // replace [links](https://example.com) with html anchor tags or a plaintext representation const linkRegex = /\[(?.*?)\]\((?.*?)\)/g; - if (linkRegex.test(c.text)) { - if (plainText) { - c.text = c.text.replace(linkRegex, '$ ($)'); - } else { - c.text = c.text.replace(linkRegex, '$'); - } + if (plainText) { + c.text = c.text.replace(linkRegex, '$ ($)'); + } else { + c.text = c.text.replace(linkRegex, '$'); } } @@ -159,7 +164,7 @@ export class CreateEmail { } else { el = `${el}`; } - innerHTML += `\n${el}`; + innerHTML += `\n${el}`; break; } });