From 13aa4055ffe328ee1b8c2ebc4044f781be308676 Mon Sep 17 00:00:00 2001 From: Ravinou Date: Thu, 27 Jun 2024 19:56:13 +0200 Subject: [PATCH] fix: adapt email template to improve GMAIL compatibility #242 --- helpers/templates/attachments/alert-icon.png | Bin 0 -> 2835 bytes helpers/templates/attachments/valid-icon.png | Bin 0 -> 1120 bytes helpers/templates/emailAlertStatus.js | 259 ++++++++----------- helpers/templates/emailTest.js | 155 ++++++----- 4 files changed, 202 insertions(+), 212 deletions(-) create mode 100644 helpers/templates/attachments/alert-icon.png create mode 100644 helpers/templates/attachments/valid-icon.png diff --git a/helpers/templates/attachments/alert-icon.png b/helpers/templates/attachments/alert-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..082898a3698b28951750a9967f47167f1284848e GIT binary patch literal 2835 zcmV+u3+(iXP)EX>4Tx04R}tkv&MmKpe$iQ?()$K|6>#WT;MdQ4ztVR-p(LO0CeUgUO{|(4-+r zad8w}3l4rPRvlcNb#-tR1i=pwX9p)m7b)?7NufoI2gm(*ckglc4iM^PrkWj5K-DZG z6_1IT?5Y@eMHhzAk68#3GxfP-G6B!=bq^n3?;bkxtDMhls^O8_R9XiiS!&MI2UCjq-(z z%L?Z$&T6^Jn)l={4Cb_zWvDp!3DHKSqJTF3_mi_V=-EH%mKj!Ztv~iGtK^f0JZCK!Hn&v$^ZZW24YJ`L;wl^k^tPo0a3pI000SaNLh0L z01ejw01ejxLMWSf00007bV*G`2j~VH5<4g;J|?XI00|FCL_t(|+U=Zwa8%V5$3N%o zCIJ#GB+7{Phb>sERA(xJQfP+}3Hbqx(56$SwzbYkmHdW)j3OH-pi&?S8$hG2*3lWJ z!4?VGMM`Ze*0%hz?M!Ver6NvSKoW$3K$h&D{t=!2;9au2*$vt3{rvgP+xzyN?>+a& zyXRi8SS%Kc#bU8oES41F!D1a=UZ_{3@;gW>{n@gadW{q20aXftQNZvIO(zr%0b8>? zJhQe%PFMjFNY&jsEF5Az@O2=ghuhC1Jlp9|)6^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1i=pwX9p)m7b)?7NufoI2gm(*ckglc4iM^PrkWj5K-DZG z6_1IT?5Y@eMHhzAk68#3GxfP-G6B!=bq^n3?;bkxtDMhls^O8_R9XiiS!&MI2UCjq-(z z%L?Z$&T6^Jn)l={4Cb_zWvDp!3DHKSqJTF3_mi_V=-EH%mKj!Ztv~iGtK^f0JZCK!Hn&v$^ZZW24YJ`L;wl^k^tPo0a3pI000SaNLh0L z01ejw01ejxLMWSf00007bV*G`2j~VH69W(yVMzY~00LY|L_t(|+U=V`ZqrZ{Mc=Es z3dADZ&eCpy2?EC;RcdE20oHge>?wupCd(8 zC%5W31IPZd2mk;80000000000000000000$N+=3S^1=M6s(lm@QPWrB>+GtFyUwVn`TxnfHPbg;?e#W5G5DU}BkPx{oJ_8>%dYmc zukuah%RRD=$J4#fUG6FJw|?@fSM<@X{$%<_{D5WD=O19*_1YydCv zlMLWVesTf4$xkYPNBPMF@G3uv0G{Q$58z$?$^gY+{>0Qy%irwn`E389nXIsT!-Jb= zB6=p(!w=P?$ut{py0`Q&rRLtcEIp7}oMS#JKYErQ&Wk30DD<9)zV|MFWq=C1YBp*v zt+hRu@*fCb??mJ_oV2ieYWiA4ev}`3;ZgpB7vcQi=DCV~tzMKw^yGY&jW+&=1MkIj z0dMVFP>K;^k-zrW(3B#?B!8p(fD|IcCV%4_G0zcVlwa#k*kgoP<=1``;VDAQ@*6!1 z@(>|*`HdgO#T>zd{Kf%djo?LokN~ko@FYK2fLJ1UlOHs|wj+3yA3VUeB6yYGN`S5- zsM$}i@>>hgN`xiP?iW9|_B=n@0IQ^#>9EdwSZln2=t{mw%P;9orrFq3kED7MruHG= zo?H2?2UtT|y*;s)mA&$9L}&6l3Gi2%=};DDxQp}L`g^neZ~yLzSmEJ<3jhEB00000 m00000000000001xKEDCVXYpy7K4ISg0000', to: mailTo, subject: 'Down status alert !', - text: 'Some repositories need attention ! Please, check your BorgWarehouse interface.', + text: 'Some repositories require your attention ! Please, check your BorgWarehouse interface.', html: ` -
-
- -
-
- BorgWarehouse -
-
- - - - - -
- -
-

Some repositories need attention,
` + + + + + + + + + +

+
+
+
BorgWarehouse
+
+ alert icon +
+
+

Some repositories require your attention, ` + username + - ` !

-
- -
-

- List of repositories with down status : -

-
    ` + + `!

    +
+
+

List of repositories with down status:

+
    ` + aliasTemplate(aliasList) + `
- -
- -
-
- 🚩 -
-
- Please remember that the status is based on - the last modification. Backups are - encrypted from end to end between your client and the - server - controlled by BorgWarehouse. Don't forget to - check the integrity of your backups regularly. -
-
-
-
-

- About - BorgWarehouse -

-
-
-`, +
+
+
🚩
+
+ Please remember that the status is based on the last modification. Backups are encrypted from end to end between your client and the server controlled by BorgWarehouse. Don't forget to check the integrity of your backups regularly. +
+
+
+ +
+ + + `, + attachments: [ + { + path: 'helpers/templates/attachments/alert-icon.png', + cid: 'alert-icon', + }, + ], }; return template; } diff --git a/helpers/templates/emailTest.js b/helpers/templates/emailTest.js index d0dcbc8..caafc6f 100644 --- a/helpers/templates/emailTest.js +++ b/helpers/templates/emailTest.js @@ -6,77 +6,98 @@ export default function emailTest(mailTo, username) { text: 'If you received this email then the mail configuration seems to be correct.', html: ` -
-
- -
-
- BorgWarehouse -
-
- - - - - -
- -
+ + + + +
+
+
+
BorgWarehouse
+
+ valid icon +
+
+

Good job, ` + + username + + `!

+
+
+

If you received this mail then the configuration seems to be correct.

+
+
+ -
-
- `, + + + `, + attachments: [ + { + path: 'helpers/templates/attachments/valid-icon.png', + cid: 'valid-icon', + }, + ], }; return template; }