diff --git a/src/assets/emails/genericTemplate.html b/src/assets/emails/genericTemplate.html index 4c28493..d1331f2 100644 --- a/src/assets/emails/genericTemplate.html +++ b/src/assets/emails/genericTemplate.html @@ -46,12 +46,6 @@ background-color: #D9C6FA !important; color: #45297A !important; } - td.primary a, - td.secondary a, - td.primary span, - td.secondary span { - text-decoration: none !important; - } td.notice { color: #c5adf2 !important; } @@ -59,8 +53,7 @@ color: #fff !important; font-weight: 700 !important; } - strong, - b { + td strong { font-weight: 700 !important; color: #9D6FF3 !important; } @@ -100,12 +93,6 @@ background-color: #373C65 !important; color: #fff !important; } - td.primary a, - td.secondary a, - td.primary span, - td.secondary span { - text-decoration: none !important; - } td.signature { color: #A1A8D9 !important; } @@ -126,6 +113,17 @@ } } + 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 { + text-decoration: none !important; + } + /* the following specifically targets gmail, because it doesn't support media queries and automatically inverts colors */ u+.email-body, u+.email-body table.centerer, @@ -145,7 +143,7 @@ color: #fff !important; } u+.email-body td a { - color: #673DB6 !important; + color: #fff !important; font-weight: 700 !important; text-decoration: underline !important; } @@ -163,12 +161,6 @@ background-image: linear-gradient(#373C65, #373C65) !important; color: #fff !important; } - u+.email-body td.primary a, - u+.email-body td.secondary a, - u+.email-body td.primary span, - u+.email-body td.secondary span { - text-decoration: none !important; - } u+.email-body td.notice { color: #fff !important; } @@ -192,8 +184,9 @@ - + +
- + - +
   @@ -264,7 +257,7 @@ -
 
+
Note: this email message was auto-generated, please do not respond. For further @@ -284,7 +277,7 @@
  
diff --git a/src/mailer.ts b/src/mailer.ts index e28b4d4..0e4ab1a 100644 --- a/src/mailer.ts +++ b/src/mailer.ts @@ -75,7 +75,7 @@ export class CreateEmail { */ public addParagraph(text: string, replacements?: emailTextReplacements): this { const component: emailComponent = { type: 'paragraph', text, replacements }; - this.componentArray.push(component, this.addPadding(0.5)); + this.componentArray.push(component, this.addPadding(1)); return this; } @@ -118,9 +118,9 @@ export class CreateEmail { if (linkRegex.test(c.text)) { if (plainText) { - c.text = c.text.replace(linkRegex, `$ ($)`); + c.text = c.text.replace(linkRegex, '$ ($)'); } else { - c.text = c.text.replace(linkRegex, `$`); + c.text = c.text.replace(linkRegex, '$'); } } } @@ -129,8 +129,15 @@ export class CreateEmail { public toHTML(): string { let innerHTML = ''; - this.componentArray.forEach((c) => { + this.componentArray.map((c, i) => { let el = ' '; + + /* double padding causes issues, and the signature already has padding, so if the last element + * is padding we just yeet it + */ + if (i === this.componentArray.length - 1 && c.type === 'padding') { + return; + } if (c.type !== 'padding') { el = this.addGmailDarkModeFix(c.text); }