File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed
Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change 5353 color : # fff !important ;
5454 font-weight : 700 !important ;
5555 }
56- td strong {
56+ td strong ,
57+ td b {
5758 font-weight : 700 !important ;
5859 color : # 9D6FF3 !important ;
5960 }
113114 }
114115 }
115116
116- td .primary a ,
117- td .secondary a ,
118- td .primary span ,
119- td .secondary span ,
120- u + .email-body td .primary a ,
121- u + .email-body td .secondary a ,
122- u + .email-body td .primary span ,
123- u + .email-body td .secondary span {
117+ td .button a ,
118+ td .button span ,
119+ u + .email-body td .button a ,
120+ u + .email-body td .button span {
124121 text-decoration : none !important ;
125122 }
126123
Original file line number Diff line number Diff line change @@ -113,15 +113,20 @@ export class CreateEmail {
113113 } ) ;
114114 }
115115
116+ // wrap <b> and <strong> in a <span> element, to fix color on thunderbird and weight on icloud mail web
117+ const bRegex = / < b ? > .* ?< \/ b > | < s t r o n g ? > .* ?< \/ s t r o n g > / g;
118+
119+ if ( ! plainText ) {
120+ c . text = c . text . replace ( bRegex , el => `<span style="color:#fff;font-weight:bold;">${ el } </span>` ) ;
121+ }
122+
116123 // replace [links](https://example.com) with html anchor tags or a plaintext representation
117124 const linkRegex = / \[ (?< linkText > .* ?) \] \( (?< linkAddress > .* ?) \) / g;
118125
119- if ( linkRegex . test ( c . text ) ) {
120- if ( plainText ) {
121- c . text = c . text . replace ( linkRegex , '$<linkText> ($<linkAddress>)' ) ;
122- } else {
123- c . text = c . text . replace ( linkRegex , '<a href="$<linkAddress>" style="text-decoration:underline;font-weight:700;color:#fff;"><u>$<linkText></u></a>' ) ;
124- }
126+ if ( plainText ) {
127+ c . text = c . text . replace ( linkRegex , '$<linkText> ($<linkAddress>)' ) ;
128+ } else {
129+ c . text = c . text . replace ( linkRegex , '<a href="$<linkAddress>" style="text-decoration:underline;font-weight:700;color:#fff;"><u>$<linkText></u></a>' ) ;
125130 }
126131 }
127132
@@ -159,7 +164,7 @@ export class CreateEmail {
159164 } else {
160165 el = `<span style="color:#fff;" width="100%">${ el } </span>` ;
161166 }
162- innerHTML += `\n<tr><td ${ c . primary ? 'class="primary" bgcolor="#673db6"' : 'class="secondary" bgcolor="#373C65"' } style="font-weight:700;border-radius:10px;padding:12px" align="center">${ el } </td></tr>` ;
167+ innerHTML += `\n<tr><td ${ c . primary ? 'class="primary button " bgcolor="#673db6"' : 'class="secondary button " bgcolor="#373C65"' } style="font-weight:700;border-radius:10px;padding:12px" align="center">${ el } </td></tr>` ;
163168 break ;
164169 }
165170 } ) ;
You can’t perform that action at this time.
0 commit comments