diff --git a/CHANGES.md b/CHANGES.md
index f37bd7bf5d..d7902bbd8c 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,14 +2,18 @@
## Features
-- New route in Locale API to fetch a list of languages
+- New route in Locale API to fetch a list of languages (@TorstenDittmann)
- Added option to force HTTPS connection to the Appwrite server (_APP_OPTIONS_FORCE_HTTPS)
- Added Google Fonts to Appwrite for offline availability
- Added a new route in the Avatars API to get user initials avatar
- Added option to delete team from the console
- Added option to view team members from the console
- Added option to join a user to any team from the console
-- Added support for Brotli compression
+- Added support for Brotli compression (@PedroCisnerosSantana, @Rohitub222)
+- New UI micro-interactions and styles fixes (@AnatoleLucet)
+- UI performance & accessibility improvments
+- Updated ClamAV conntainer to version 1.0.9
+- All emails are now sent asynchronously for improved performance (@TorstenDittmann)
## Bug Fixes
diff --git a/app/app.php b/app/app.php
index 35f208b335..dcab392a73 100644
--- a/app/app.php
+++ b/app/app.php
@@ -27,6 +27,7 @@ $services = include __DIR__.'/config/services.php'; // List of services
$webhook = new Event('v1-webhooks', 'WebhooksV1');
$audit = new Event('v1-audits', 'AuditsV1');
$usage = new Event('v1-usage', 'UsageV1');
+$mail = new Event('v1-mails', 'MailsV1');
$deletes = new Event('v1-deletes', 'DeletesV1');
/**
@@ -53,7 +54,7 @@ $clients = array_unique(array_merge($clientsConsole, array_map(function ($node)
return false;
}))));
-$utopia->init(function () use ($utopia, $request, $response, &$user, $project, $console, $roles, $webhook, $audit, $usage, $clients) {
+$utopia->init(function () use ($utopia, $request, $response, &$user, $project, $console, $roles, $webhook, $mail, $audit, $usage, $clients) {
$route = $utopia->match($request);
diff --git a/app/config/locales/templates/_base.tpl b/app/config/locales/templates/_base.tpl
new file mode 100644
index 0000000000..561ce73855
--- /dev/null
+++ b/app/config/locales/templates/_base.tpl
@@ -0,0 +1,238 @@
+
+
+
+
+
+
+ {{title}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{content}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/config/locales/templates/_cta.tpl b/app/config/locales/templates/_cta.tpl
new file mode 100644
index 0000000000..634609a09e
--- /dev/null
+++ b/app/config/locales/templates/_cta.tpl
@@ -0,0 +1,26 @@
+
\ No newline at end of file
diff --git a/app/config/locales/templates/af.email.auth.confirm.tpl b/app/config/locales/templates/af.email.auth.confirm.tpl
index e0a6c40356..a9dbb2af46 100644
--- a/app/config/locales/templates/af.email.auth.confirm.tpl
+++ b/app/config/locales/templates/af.email.auth.confirm.tpl
@@ -1,24 +1,15 @@
-
-
-
+
Hallo {{name}},
-
-
+
+
Om jou epos adres te verifieer, kliek op die web adres hier:
-
- {{redirect}}
-
-
+
+{{cta}}
+
As jy nie aangevra het om jou epos adres te verifieer nie, kan jy die boodskap ignoreer.
-
-
+
+
Baie dankie,
{{project}} span
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/af.email.auth.invitation.tpl b/app/config/locales/templates/af.email.auth.invitation.tpl
index eed6cf69d1..0c1c72c13a 100644
--- a/app/config/locales/templates/af.email.auth.invitation.tpl
+++ b/app/config/locales/templates/af.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Hallo,
-
-
+
+
Hierdie epos is vir jou gestuur omdat {{owner}} jou graag wou nooi om 'n spanlid te word van {{team}} by {{project}}.
-
-
+
+
Om by die {{team}} span aan te sluit:
-
- {{redirect}}
-
-
+
+{{cta}}
+
As jy nie belangstel nie, kan jy die boodskap ignoreer.
-
-
+
اتبع هذا الرابط للتحقق من عنوان بريدك الإلكتروني.
-
- {{redirect}}
-
-
+
+{{cta}}
+
إذا لم تطلب التحقق من هذا العنوان، فيمكنك تجاهل هذه الرسالة.
-
-
+
+
Thanks,
فريق {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/ar.email.auth.invitation.tpl b/app/config/locales/templates/ar.email.auth.invitation.tpl
index fba4a731e3..78a1321dab 100644
--- a/app/config/locales/templates/ar.email.auth.invitation.tpl
+++ b/app/config/locales/templates/ar.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
مرحبا،
-
-
+
+
تم إرسال هذه الرسالة إليك لأن {{owner}} أراد دعوتك لتصبح عضوًا في فريق {{team}} في {{project}}.
-
-
+
+
اتبع هذا الرابط للانضمام إلى فريق {{team}}:
-
- {{redirect}}
-
-
+
bitte folge diesem Link um deine E-Mail Adresse zu verifizieren.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Bitte ignoriere diese Nachricht, wenn du das Verifizieren deiner E-Mail Adresse nicht beantragt hast.
-
-
+
+
Vielen Dank,
{{project}} Team
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/de.email.auth.invitation.tpl b/app/config/locales/templates/de.email.auth.invitation.tpl
index c6d9162730..ae55630797 100644
--- a/app/config/locales/templates/de.email.auth.invitation.tpl
+++ b/app/config/locales/templates/de.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Hallo,
-
-
+
+
diese E-Mail wurde dir geschickt, weil {{owner}} dich eingeladen hat Teammitglied im Team {{team}} bei {{project}} zu werden.
-
-
+
+
Folge diesem Link um dem Team {{team}} beizutreten:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Wenn du daran nicht interessiert bist, kannst du diese Nachricht ignorieren.
-
-
+
Follow this link to verify your email address.
-
- {{redirect}}
-
-
+
+{{cta}}
+
If you didn’t ask to verify this address, you can ignore this message.
-
-
+
+
Thanks,
{{project}} team
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/en.email.auth.invitation.tpl b/app/config/locales/templates/en.email.auth.invitation.tpl
index fda2bbcce0..70ea922c0c 100644
--- a/app/config/locales/templates/en.email.auth.invitation.tpl
+++ b/app/config/locales/templates/en.email.auth.invitation.tpl
@@ -1,27 +1,14 @@
-
-
-
- Hello,
-
-
+
+ Hello,
+
+
This mail was sent to you because {{owner}} wanted to invite you to become a team member at the {{team}} team over at {{project}}.
-
-
- Follow this link to join the {{team}} team:
-
- {{redirect}}
-
-
- If you are not interested, you can ignore this message.
-
-
+
+{{cta}}
+
+ If you are not interested, you can ignore this message.
+
Thanks,
{{project}} team
-
+
\ No newline at end of file
diff --git a/app/config/locales/templates/en.email.auth.recovery.tpl b/app/config/locales/templates/en.email.auth.recovery.tpl
index 82b365546a..a4a982f46f 100644
--- a/app/config/locales/templates/en.email.auth.recovery.tpl
+++ b/app/config/locales/templates/en.email.auth.recovery.tpl
@@ -1,24 +1,15 @@
-
-
-
+
Hello {{name}},
-
-
+
+
Follow this link to reset your {{project}} password.
-
- {{redirect}}
-
-
- If you didn't ask to reset your password, you can ignore this message.
-
-
+
+{{cta}}
+
+ If you didn’t ask to verify this address, you can ignore this message.
+
+
Thanks,
{{project}} team
-
+
\ No newline at end of file
diff --git a/app/config/locales/templates/es.email.auth.confirm.tpl b/app/config/locales/templates/es.email.auth.confirm.tpl
index a5b9235be8..2c728ddce1 100644
--- a/app/config/locales/templates/es.email.auth.confirm.tpl
+++ b/app/config/locales/templates/es.email.auth.confirm.tpl
@@ -1,24 +1,15 @@
-
-
-
+
Hola {{name}},
-
-
+
+
Sigue este enlace para verificar tu dirección de correo.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Si no has solicitado verificar esta dirección, puedes ignorar este mensaje.
-
-
+
Varmista sähköpostiosoite tästä linkistä.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Jos et kysynyt tämän sähköpostiosoitteen varmistamista, voit sivuuttaa tämän viestin.
-
-
+
+
kiitos,
{{project}} tiimi
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/fi.email.auth.invitation.tpl b/app/config/locales/templates/fi.email.auth.invitation.tpl
index 7e955d0216..6680259aa7 100644
--- a/app/config/locales/templates/fi.email.auth.invitation.tpl
+++ b/app/config/locales/templates/fi.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Hei,
-
-
+
+
Sait tämän sähköpostin koska {{owner}} halusi kutsua sinut jäseneksi {{team}} tiimiin, täällä {{project}}.
-
-
+
Jos et pyytänyt salasanan nollaamista, voit sivuuttaa tämän viestin-
-
-
+
+
Kiitos,
{{project}} tiimi
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/fo.email.auth.confirm.tpl b/app/config/locales/templates/fo.email.auth.confirm.tpl
index 9af52651b8..5400c2ab01 100644
--- a/app/config/locales/templates/fo.email.auth.confirm.tpl
+++ b/app/config/locales/templates/fo.email.auth.confirm.tpl
@@ -1,24 +1,15 @@
-
-
-
Om tú ikke spurdi om at verifisera hesa teldupostur, kannst tú ignorera hesa boð.
-
-
+
+
Takk,
{{project}} lið
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/fo.email.auth.invitation.tpl b/app/config/locales/templates/fo.email.auth.invitation.tpl
index 586daac0e4..c264c7516f 100644
--- a/app/config/locales/templates/fo.email.auth.invitation.tpl
+++ b/app/config/locales/templates/fo.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Halló,
-
-
+
+
Hesa teldupost var send til tín tí {{owner}} vildi bjóða tær at vera eitt lið limur hjá {{team}} á {{project}}
-
-
+
+
Fylg hettar lenka fyrið at bliva vi {{team}} lið:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Om tú ikke er áhugaður, kannst tú ignorera hesa boð
-
-
+
Ακολούθησε αυτό τον σύνδεσμο για να επιβεβαιώσεις τη διεύθυνση email σου.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Αν δεν ζήτησες να επιβεβαιώσεις αυτή τη διεύθυνση, μπορείς να αγνοήσεις αυτό το μήνυμα.
-
-
+
+
Ευχαριστούμε,
Η ομάδα του {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/gr.email.auth.invitation.tpl b/app/config/locales/templates/gr.email.auth.invitation.tpl
index 101a1c673c..a7c0743ff6 100644
--- a/app/config/locales/templates/gr.email.auth.invitation.tpl
+++ b/app/config/locales/templates/gr.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Γεια,
-
-
+
+
Έλαβες αυτό το email επειδή ο {{owner}} σε προσκάλεσε να γίνεις μέλος της ομάδας {{team}} στο {{project}}.
-
-
+
+
Ακολούθησε αυτό τον σύνδεσμο για να γίνεις μέλος της ομάδας {{team}}:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Άν δεν ενδιαφέρεσαι, μπορείς να αγνοήσεις αυτό το μήνυμα.
-
-
+
נא ללחוץ על הקישור שלהלן כדי לאמת את החשבון שלך.
-
- {{redirect}}
-
-
+
+{{cta}}
+
אם לא ביקשת לאמת את כתובת הדוא״ל, ניתן להתעלם מההודעה זו.
-
-
+
+
בברכה,
צוות {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/he.email.auth.invitation.tpl b/app/config/locales/templates/he.email.auth.invitation.tpl
index a7514affda..9a9226a5ba 100644
--- a/app/config/locales/templates/he.email.auth.invitation.tpl
+++ b/app/config/locales/templates/he.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
שלום,
-
-
+
+
הודעת דוא״ל זו נשלחה אליך כי {{owner}} ביקש להזמינך להצטרף לצוות {{team}} ב־{{project}}.
-
-
+
+
כדי להצטרף לצוות {{team}}, נא ללחוץ על הקישור:
-
- {{redirect}}
-
-
+
+{{cta}}
+
אם איך לך עניין להצטרף לצוות, ניתן להתעלם מהודעת דוא״ל זו.
-
-
+
Անցեք հղումով, որպեսզի հաստատեք Ձեր էլեկտրոնային հասցեն։
-
- {{redirect}}
-
-
+
+{{cta}}
+
Եթե չեք պահանջել էլեկտրոնային հասցեի հաստատում, պարզապես արհամարհեք այս նամակը։
-
-
+
+
Շնորհակալություն,
{{project}} թիմ
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/hy.email.auth.invitation.tpl b/app/config/locales/templates/hy.email.auth.invitation.tpl
index e471c81b63..2d0f125403 100644
--- a/app/config/locales/templates/hy.email.auth.invitation.tpl
+++ b/app/config/locales/templates/hy.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Ողջույն,
-
-
+
+
Դուք ստացել եք այս նամակը, քանի որ {{owner}}-ը հրավիրում է Ձեզ {{team}} խումբ, {{project}} պրոեկտում։
-
-
+
Ikuti link ini untuk memverifikasi alamat email Anda.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Jika Anda tidak meminta untuk memverifikasi alamat ini, Anda dapat mengabaikan pesan ini.
-
-
+
+
Terima kasih,
Tim {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/id.email.auth.invitation.tpl b/app/config/locales/templates/id.email.auth.invitation.tpl
index 7ab49b2002..d81a4a5d83 100644
--- a/app/config/locales/templates/id.email.auth.invitation.tpl
+++ b/app/config/locales/templates/id.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Halo,
-
-
+
+
Email ini dikirimkan kepada Anda karena {{owner}} ingin mengundang Anda untuk menjadi anggota tim {{team}} di {{project}}.
-
-
+
+
Ikuti link ini untuk bergabung dengan tim {{team}}:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Jika Anda tidak tertarik, Anda dapat mengabaikan pesan ini.
-
-
+
Þessi póstur var sendur til þín vegna þess að {{owner}} vildi bjóða þér að gerast liðsmaður í {{team}} teymi í {{project}}.
-
-
+
+
Fylgdu þessum hlekk til að ganga í {{team}} liðið:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Ef þú hefur ekki áhuga geturðu hunsað þessi skilaboð.
-
-
+
+
Takk,
{{project}} Teymi
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/is.email.auth.recovery.tpl b/app/config/locales/templates/is.email.auth.recovery.tpl
index fc3bc57722..edddba1ffb 100644
--- a/app/config/locales/templates/is.email.auth.recovery.tpl
+++ b/app/config/locales/templates/is.email.auth.recovery.tpl
@@ -1,24 +1,15 @@
-
-
-
+
Halló {{name}},
-
-
+
+
Fylgdu þessum tengli til að núllstilla lykilorð {{project}}.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Ef þú baðst ekki um að endurstilla lykilorðið þitt geturðu hunsað þessi skilaboð.
-
-
+
+
Takk,
{{project}} Teymi
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/it.email.auth.confirm.tpl b/app/config/locales/templates/it.email.auth.confirm.tpl
index 93ee5e006f..ec7837ec3d 100644
--- a/app/config/locales/templates/it.email.auth.confirm.tpl
+++ b/app/config/locales/templates/it.email.auth.confirm.tpl
@@ -1,25 +1,16 @@
-
-
-
+
Ciao {{name}},
-
-
+
+
Segui questo link per verificare il tuo indirizzo email.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Se non hai chiesto di verificare questo indirizzo, puoi ignorare questo messaggio.
-
-
+
+
Grazie,
Il team di {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/it.email.auth.invitation.tpl b/app/config/locales/templates/it.email.auth.invitation.tpl
index e6eddb5d1b..f4b8e4f93b 100644
--- a/app/config/locales/templates/it.email.auth.invitation.tpl
+++ b/app/config/locales/templates/it.email.auth.invitation.tpl
@@ -1,28 +1,19 @@
-
-
-
+
Ciao,
-
-
+
+
Questa mail ti è stata inviata perchè {{owner}} vuole invitarti a diventare un membro del team {{team}} del progetto {{project}}.
-
-
+
+
Segui questo link per unirti al team {{team}}:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Se non sei interessato, puoi ignorare questo messaggio.
-
-
+
+
Grazie,
Il team di {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/it.email.auth.recovery.tpl b/app/config/locales/templates/it.email.auth.recovery.tpl
index 64e865fe76..870b3ab0f5 100644
--- a/app/config/locales/templates/it.email.auth.recovery.tpl
+++ b/app/config/locales/templates/it.email.auth.recovery.tpl
@@ -1,24 +1,15 @@
-
-
-
+
Ciao {{name}},
-
-
+
+
Segui questo link per reimpostare la tua password per {{project}}.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Se non hai chiesto di reimpostare la password, puoi ignorare questo messaggio.
-
-
+
+
Grazie,
Il team di {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/ja.email.auth.confirm.tpl b/app/config/locales/templates/ja.email.auth.confirm.tpl
index 6c7a89f355..a06f96cd83 100644
--- a/app/config/locales/templates/ja.email.auth.confirm.tpl
+++ b/app/config/locales/templates/ja.email.auth.confirm.tpl
@@ -1,24 +1,15 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/ja.email.auth.invitation.tpl b/app/config/locales/templates/ja.email.auth.invitation.tpl
index ed59caff07..26d5de981b 100644
--- a/app/config/locales/templates/ja.email.auth.invitation.tpl
+++ b/app/config/locales/templates/ja.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
Email iki dikirim menyang sampeyan amarga {{owner}} pengin ngajak sampeyan dadi anggota tim ing {{team}} tim ing {{project}}.
-
-
+
+
Tindakake link iki kanggo gabung ing {{team}}:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Yen sampeyan ora kasengsem, sampeyan bisa nglirwakake pesen iki.
-
-
+
+
Matur suwun,
tim {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/jv.email.auth.recovery.tpl b/app/config/locales/templates/jv.email.auth.recovery.tpl
index ed6c879aeb..1efd86bc77 100644
--- a/app/config/locales/templates/jv.email.auth.recovery.tpl
+++ b/app/config/locales/templates/jv.email.auth.recovery.tpl
@@ -1,24 +1,15 @@
-
-
-
+
Halo {{name}},
-
-
+
+
Tindakake link iki kanggo ngreset {{project}} sandhi.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Yen sampeyan ora njaluk ngreset sandhi, sampeyan bisa nglalekake pesen iki.
-
-
+
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/km.email.auth.invitation.tpl b/app/config/locales/templates/km.email.auth.invitation.tpl
index 910a14451f..a366ed73e9 100644
--- a/app/config/locales/templates/km.email.auth.invitation.tpl
+++ b/app/config/locales/templates/km.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/ko.email.auth.invitation.tpl b/app/config/locales/templates/ko.email.auth.invitation.tpl
index 4fc62b8516..21ed74de68 100644
--- a/app/config/locales/templates/ko.email.auth.invitation.tpl
+++ b/app/config/locales/templates/ko.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
Ikuti pautan ini untuk mengesahkan alamat e-mel anda.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Jika anda tidak meminta untuk mengesahkan alamat ini, anda boleh mengabaikan mesej ini.
-
-
+
+
Terima kasih,
Kumpulan {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/my.email.auth.invitation.tpl b/app/config/locales/templates/my.email.auth.invitation.tpl
index 891e1eb4de..66e38bb608 100644
--- a/app/config/locales/templates/my.email.auth.invitation.tpl
+++ b/app/config/locales/templates/my.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Hello,
-
-
+
+
E-mel ini dihantar kepada anda kerana {{owner}}ingin mengundang Anda untuk menjadi anggota kumpulan {{team}} di dalam {{project}}.
-
-
+
+
Ikuti pautan ini untuk menyertai kumpulan {{team}}:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Sekiranya anda tidak berminat,anda boleh mengabaikan mesej ini.
-
-
+
Klink op deze link om uw emailadres te valideren.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Als u niet heeft gevraagd om dit adres te verifiëren, kunt u dit bericht negeren.
-
-
+
+
Bedankt,
{{project}} team
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/nl.email.auth.invitation.tpl b/app/config/locales/templates/nl.email.auth.invitation.tpl
index 252e104aff..75ac6f4510 100644
--- a/app/config/locales/templates/nl.email.auth.invitation.tpl
+++ b/app/config/locales/templates/nl.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Hallo,
-
-
+
+
Deze mail is naar je gestuurd omdat {{owner}} wilde dat u een lid zou worden in het {{team}} team voor {{project}}.
-
-
+
+
Volg deze link om het team te joinen {{team}}:
-
- {{redirect}}
-
-
+
+{{cta}}
+
ALs u niet geïnteresseerd bent, kunt u dit bericht negeren.
-
-
+
Følg denne lenken for å verifisere din e-postadresse.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Hvis du ikke har spurt om å verifisere din e-post, kan du ignorere denne meldingen.
-
-
+
+
Hilsen,
{{project}}-teamet
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/no.email.auth.invitation.tpl b/app/config/locales/templates/no.email.auth.invitation.tpl
index c56e913d3d..00cd9defe5 100644
--- a/app/config/locales/templates/no.email.auth.invitation.tpl
+++ b/app/config/locales/templates/no.email.auth.invitation.tpl
@@ -1,28 +1,19 @@
-
-
-
+
Hei,
-
-
+
+
Denne mailen ble sendt til deg fordi {{owner}} har invitert deg til å bli medlem av {{team}}-teamet på {{project}}.
-
-
+
+
Follow this link to join the {{team}} team:
Følg denne lenken for å bli med på {{team}}-teamet:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Hvis du ikke er interresert kan du ignorere denne meldingen.
-
-
+
Sundun ang link na ito upang ma-verify ang iyong email address.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Kung hindi mo hiniling na i-verify ang address na ito, maaari mong balewalain ang mensaheng ito.
-
-
+
+
Salamat,
Pangkat ng {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/ph.email.auth.invitation.tpl b/app/config/locales/templates/ph.email.auth.invitation.tpl
index f8a8668e50..23916efb0c 100644
--- a/app/config/locales/templates/ph.email.auth.invitation.tpl
+++ b/app/config/locales/templates/ph.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Kamusta,
-
-
+
+
Ipinadala ang email na ito sa iyo dahil nais kang anyayahan ni {{ owner }} upang maging isang kasapi ng pangkat ng {{ team }} sa {{ project }}.
-
-
+
+
Sundan ang link na ito upang sumali sa pangkat ng {{team}}:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Kung hindi ka interesado, maari mong balewalain ang mensahing ito.
-
-
+
Kliknij ten link, aby zweryfikować swój adres e-mail.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Jeśli nie prosiłeś o weryfikację tego adresu, możesz zignorować tę wiadomość.
-
-
+
+
Dziękujemy,
zespół {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/pl.email.auth.invitation.tpl b/app/config/locales/templates/pl.email.auth.invitation.tpl
index d11586de75..387b2e4ae8 100644
--- a/app/config/locales/templates/pl.email.auth.invitation.tpl
+++ b/app/config/locales/templates/pl.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Witaj,
-
-
+
+
Ta wiadomość została do Ciebie wysłana, ponieważ {{owner}} chciałby zaprosić Cię do dołączenia do zespołu {{team}} w {{project}}.
-
-
+
+
Kliknij ten link, aby dołączyć do zespołu {{team}}:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Jeśli nie jesteś zainteresowany, możesz zignorować tę wiadomość.
-
-
+
Por favor, confirme o seu email através do link abaixo.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Se não solicitou a confirmação de email, por favor ignore esta mensagem.
-
-
+
+
Com os melhores cumprimentos,
Equipa {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/pt-pt.email.auth.invitation.tpl b/app/config/locales/templates/pt-pt.email.auth.invitation.tpl
index 429a30be9a..c0bdfa4136 100644
--- a/app/config/locales/templates/pt-pt.email.auth.invitation.tpl
+++ b/app/config/locales/templates/pt-pt.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Olá,
-
-
+
+
Recebeu este email porque {{owner}} deseja convidá-lo a tornar-se membro da equipa {{team}} no {{project}}.
-
-
+
+
Use este link para se juntar à equipa {{team}}:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Se não estiver interessado, por favor ignore esta mensagem.
-
-
+
+
Com os melhores cumprimentos,
Equipa {{project}}
-
Перейдите по ссылке, чтобы подтвердить свой адрес электронной почты.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Если вы не запрашивали подтверждение этого адреса, проигнорируйте это сообщение.
-
-
+
+
Спасибо,
команда {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/ru.email.auth.invitation.tpl b/app/config/locales/templates/ru.email.auth.invitation.tpl
index 41de21d09f..7dc637a3de 100644
--- a/app/config/locales/templates/ru.email.auth.invitation.tpl
+++ b/app/config/locales/templates/ru.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Здравствуйте,
-
-
+
+
Это письмо отправлено вам, потому что {{owner}} приглашает стать членом команды {{team}} в проекте {{project}}.
-
-
+
+
Перейдите по ссылке, чтобы присоединиться к команде {{team}} :
-
- {{redirect}}
-
-
+
+{{cta}}
+
Если вы не заинтересованы, проигнорируйте это сообщение.
-
-
+
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/si.email.auth.invitation.tpl b/app/config/locales/templates/si.email.auth.invitation.tpl
index 1a0842d2e8..2fa979751e 100644
--- a/app/config/locales/templates/si.email.auth.invitation.tpl
+++ b/app/config/locales/templates/si.email.auth.invitation.tpl
@@ -1,31 +1,22 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/si.email.auth.recovery.tpl b/app/config/locales/templates/si.email.auth.recovery.tpl
index bcf32b61ba..4df6902070 100644
--- a/app/config/locales/templates/si.email.auth.recovery.tpl
+++ b/app/config/locales/templates/si.email.auth.recovery.tpl
@@ -1,25 +1,15 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/sl.email.auth.confirm.tpl b/app/config/locales/templates/sl.email.auth.confirm.tpl
index e7f15272da..fb6c4a59d1 100644
--- a/app/config/locales/templates/sl.email.auth.confirm.tpl
+++ b/app/config/locales/templates/sl.email.auth.confirm.tpl
@@ -1,24 +1,15 @@
-
-
-
+
Pozdravljeni {{name}},
-
-
+
+
Sledite tej povezavi za potrditev vašega email naslova.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Če niste zahtevali potrditve tega naslova, lahko to sporočilo prezrete.
-
-
+
+
Hvala,
{{project}} ekipa
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/sl.email.auth.invitation.tpl b/app/config/locales/templates/sl.email.auth.invitation.tpl
index 13467789a3..0dc64594b0 100644
--- a/app/config/locales/templates/sl.email.auth.invitation.tpl
+++ b/app/config/locales/templates/sl.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Pozdravljeni,
-
-
+
+
To sporočilo vam je bilo posredovano, ker vas je {{owner}} povabil/a, da postanete član {{team}} ekipe za {{project}}.
-
-
+
+
Sledite tej povezavi, da se pridružite {{team}} ekipi:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Če vas ne zanima, lahko to sporočilo prezrete.
-
-
+
Vänligen följ länken nedan för att verifiera din epostadress.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Om du inte vill verifiera din epostadress så kan du ignorera detta meddelande.
-
-
+
+
Tack,
{{project}}-teamet
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/sv.email.auth.invitation.tpl b/app/config/locales/templates/sv.email.auth.invitation.tpl
index 604e94227d..12f4ddf858 100644
--- a/app/config/locales/templates/sv.email.auth.invitation.tpl
+++ b/app/config/locales/templates/sv.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Hej,
-
-
+
+
{{owner}} vill bjuda in dig att bli del av {{team}}-teamet inom {{project}}.
-
-
+
+
Följ denna länk för att bli del av {{team}}-teamet:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Om du inte är intresserad så kan du ignorera detta meddelande.
-
-
+
இந்த மின்னஞ்சல் உங்களுக்கு அனுப்பப்பட்டது, ஏனெனில் {{owner}} உங்களை {{team}} குழுவின் {{project}} திட்டத்தில் உறுப்பினராக அழைக்க விரும்பினார்கள்.
-
-
+
+
இந்த இணைப்பைப் பின்தொடர்ந்து {{team}} குழுவில் சேரவும்:
-
- {{redirect}}
-
-
+
+{{cta}}
+
இந்த முகவரியை சரிபார்க்க நீங்கள் கேட்கவில்லை என்றால், இந்த செய்தியை நீங்கள் புறக்கணிக்கலாம்.
-
-
+
Aşağıdaki bağlantıyı takip ederek email hesabınızı doğrulayın.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Bu adresi doğrulamayı istemediyseniz, bu mesajı yok sayabilirsiniz.
-
-
+
+
Teşekkürler,
{{project}} takımı
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/tr.email.auth.invitation.tpl b/app/config/locales/templates/tr.email.auth.invitation.tpl
index 07e8f06db4..c3c35b6bbd 100644
--- a/app/config/locales/templates/tr.email.auth.invitation.tpl
+++ b/app/config/locales/templates/tr.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Merhaba,
-
-
+
+
Bu posta size gönderildi, çünkü {{owner}} sizi {{project}} için {{team}} ekibinde takım üyesi olmaya davet etmek istedi.
-
-
+
+
Aşağıdaki bağlantıyı takip ederek {{team}} takımına takılın:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Eğer ilgilenmiyorsanız, bu mesajı yok sayabilirsiniz.
-
-
+
Перейдіть за цим посиланням, та підтвердіть свою електронну адресу
-
- {{redirect}}
-
-
+
+{{cta}}
+
Якщо ви не запитували підтвердження цієї адреси, проігноруйте це повідомлення.
-
-
+
+
Дякуємо,
команда {{project}}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/ua.email.auth.invitation.tpl b/app/config/locales/templates/ua.email.auth.invitation.tpl
index 8daaecbaaf..dc4d3aed02 100644
--- a/app/config/locales/templates/ua.email.auth.invitation.tpl
+++ b/app/config/locales/templates/ua.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Вітаємо,
-
-
+
+
Цей лист був надісланий вам тому що {{owner}} хоче запросити вас стати членом команди {{team}} у {{project}}.
-
-
+
+
Перейдіть за цим посиланням щоб приєднатись до команди {{team}} :
-
- {{redirect}}
-
-
+
+{{cta}}
+
Якщо ви не зацікавлені, проігноруйте це повідомлення.
-
-
+
Hãy vào liên kết này để xác nhận địa chỉ email của bạn.
-
- {{redirect}}
-
-
+
+{{cta}}
+
Xin hãy bỏ qua email này nếu bạn không yêu cầu xác nhận địa chỉ này.
-
-
+
+
Xin cảm ơn,
{{project}} team
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/vi.email.auth.invitation.tpl b/app/config/locales/templates/vi.email.auth.invitation.tpl
index 387c537f55..8d222ea8c7 100644
--- a/app/config/locales/templates/vi.email.auth.invitation.tpl
+++ b/app/config/locales/templates/vi.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
+
Xin chào,
-
-
+
+
Bạn nhận được email này vì {{owner}} muốn mời bạn tham gia {{project}} cùng với {{team}} team.
-
-
+
+
Hãy theo liên kết này để tham gia vào {{team}} team:
-
- {{redirect}}
-
-
+
+{{cta}}
+
Nếu bạn không thích tham gia, hãy bỏ qua lời nhắn này.
-
-
+
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/zh-cn.email.auth.invitation.tpl b/app/config/locales/templates/zh-cn.email.auth.invitation.tpl
index 7ee56a401a..4ef8caba5c 100644
--- a/app/config/locales/templates/zh-cn.email.auth.invitation.tpl
+++ b/app/config/locales/templates/zh-cn.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/zh-tw.email.auth.invitation.tpl b/app/config/locales/templates/zh-tw.email.auth.invitation.tpl
index 08fb921fd7..b5e6cc8225 100644
--- a/app/config/locales/templates/zh-tw.email.auth.invitation.tpl
+++ b/app/config/locales/templates/zh-tw.email.auth.invitation.tpl
@@ -1,27 +1,18 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/config/locales/templates/zh-tw.email.auth.recovery.tpl b/app/config/locales/templates/zh-tw.email.auth.recovery.tpl
index 8a473b5537..1144b36b3c 100644
--- a/app/config/locales/templates/zh-tw.email.auth.recovery.tpl
+++ b/app/config/locales/templates/zh-tw.email.auth.recovery.tpl
@@ -1,25 +1,16 @@
-
-
-
+
{{name}} 你好,
-
-
+
+
请点击下方的链接重新设置{{project}}的密码。
Follow this link to reset your {{project}} password.
-
- {{redirect}}
-
-
+
+{{cta}}
+
如果您未曾申请重设密码,请忽略本邮件。
-
-
+
+
谢谢。
来自 {{project}}
-
+
diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php
index 282a5d9a22..504d2940b8 100644
--- a/app/controllers/api/account.php
+++ b/app/controllers/api/account.php
@@ -1,7 +1,7 @@
post('/v1/account')
->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.')
->param('name', '', function () { return new Text(100); }, 'User name.', true)
->action(
- function ($email, $password, $name) use ($register, $request, $response, $audit, $projectDB, $project, $webhook, $oauth2Keys) {
+ function ($email, $password, $name) use ($request, $response, $audit, $projectDB, $project, $webhook, $oauth2Keys) {
if ('console' === $project->getId()) {
$whitlistEmails = $project->getAttribute('authWhitelistEmails');
$whitlistIPs = $project->getAttribute('authWhitelistIPs');
@@ -1053,7 +1053,7 @@ $utopia->post('/v1/account/recovery')
->param('email', '', function () { return new Email(); }, 'User email.')
->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.')
->action(
- function ($email, $url) use ($request, $response, $projectDB, $register, $audit, $project) {
+ function ($email, $url) use ($request, $response, $projectDB, $mail, $audit, $project) {
$profile = $projectDB->getCollection([ // Get user by email address
'limit' => 1,
'first' => true,
@@ -1098,27 +1098,34 @@ $utopia->post('/v1/account/recovery')
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $profile->getId(), 'secret' => $secret]);
$url = Template::unParseURL($url);
- $body = new Template(__DIR__.'/../../config/locales/templates/'.Locale::getText('account.emails.recovery.body'));
+ $body = new Template(__DIR__.'/../../config/locales/templates/_base.tpl');
+ $content = new Template(__DIR__.'/../../config/locales/templates/'.Locale::getText('account.emails.recovery.body'));
+ $cta = new Template(__DIR__.'/../../config/locales/templates/_cta.tpl');
+
$body
+ ->setParam('{{content}}', $content->render())
+ ->setParam('{{cta}}', $cta->render())
+ ->setParam('{{title}}', Locale::getText('account.emails.recovery.title'))
->setParam('{{direction}}', Locale::getText('settings.direction'))
->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]']))
->setParam('{{name}}', $profile->getAttribute('name'))
->setParam('{{redirect}}', $url)
+ ->setParam('{{bg-body}}', '#f6f6f6')
+ ->setParam('{{bg-content}}', '#ffffff')
+ ->setParam('{{bg-cta}}', '#3498db')
+ ->setParam('{{bg-cta-hover}}', '#34495e')
+ ->setParam('{{text-content}}', '#000000')
+ ->setParam('{{text-cta}}', '#ffffff')
;
- $mail = $register->get('smtp'); /* @var $mail \PHPMailer\PHPMailer\PHPMailer */
-
- $mail->addAddress($profile->getAttribute('email', ''), $profile->getAttribute('name', ''));
-
- $mail->Subject = Locale::getText('account.emails.recovery.title');
- $mail->Body = $body->render();
- $mail->AltBody = strip_tags($body->render());
-
- try {
- $mail->send();
- } catch (\Exception $error) {
- throw new Exception('Error sending mail: ' . $error->getMessage(), 500);
- }
+ $mail
+ ->setParam('event', 'account.recovery.create')
+ ->setParam('recipient', $profile->getAttribute('email', ''))
+ ->setParam('name', $profile->getAttribute('name', ''))
+ ->setParam('subject', Locale::getText('account.emails.recovery.title'))
+ ->setParam('body', $body->render())
+ ->trigger();
+ ;
$audit
->setParam('userId', $profile->getId())
@@ -1214,7 +1221,7 @@ $utopia->post('/v1/account/verification')
->label('abuse-key', 'url:{url},email:{param-email}')
->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.') // TODO add built-in confirm page
->action(
- function ($url) use ($request, $response, $register, $user, $project, $projectDB, $audit) {
+ function ($url) use ($request, $response, $mail, $user, $project, $projectDB, $audit) {
$verificationSecret = Auth::tokenGenerator();
$verification = new Document([
@@ -1247,27 +1254,34 @@ $utopia->post('/v1/account/verification')
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $user->getId(), 'secret' => $verificationSecret]);
$url = Template::unParseURL($url);
- $body = new Template(__DIR__.'/../../config/locales/templates/'.Locale::getText('account.emails.verification.body'));
+ $body = new Template(__DIR__.'/../../config/locales/templates/_base.tpl');
+ $content = new Template(__DIR__.'/../../config/locales/templates/'.Locale::getText('account.emails.verification.body'));
+ $cta = new Template(__DIR__.'/../../config/locales/templates/_cta.tpl');
+
$body
+ ->setParam('{{content}}', $content->render())
+ ->setParam('{{cta}}', $cta->render())
+ ->setParam('{{title}}', Locale::getText('account.emails.verification.title'))
->setParam('{{direction}}', Locale::getText('settings.direction'))
->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]']))
->setParam('{{name}}', $user->getAttribute('name'))
->setParam('{{redirect}}', $url)
+ ->setParam('{{bg-body}}', '#f6f6f6')
+ ->setParam('{{bg-content}}', '#ffffff')
+ ->setParam('{{bg-cta}}', '#3498db')
+ ->setParam('{{bg-cta-hover}}', '#34495e')
+ ->setParam('{{text-content}}', '#000000')
+ ->setParam('{{text-cta}}', '#ffffff')
;
- $mail = $register->get('smtp'); /* @var $mail \PHPMailer\PHPMailer\PHPMailer */
-
- $mail->addAddress($user->getAttribute('email'), $user->getAttribute('name'));
-
- $mail->Subject = Locale::getText('account.emails.verification.title');
- $mail->Body = $body->render();
- $mail->AltBody = strip_tags($body->render());
-
- try {
- $mail->send();
- } catch (\Exception $error) {
- throw new Exception('Problem sending mail: ' . $error->getMessage(), 500);
- }
+ $mail
+ ->setParam('event', 'account.verification.create')
+ ->setParam('recipient', $user->getAttribute('email'))
+ ->setParam('name', $user->getAttribute('name'))
+ ->setParam('subject', Locale::getText('account.emails.verification.title'))
+ ->setParam('body', $body->render())
+ ->trigger()
+ ;
$audit
->setParam('userId', $user->getId())
diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php
index ded2445faa..125f159035 100644
--- a/app/controllers/api/teams.php
+++ b/app/controllers/api/teams.php
@@ -1,6 +1,6 @@
post('/v1/teams/:teamId/memberships')
->param('roles', [], function () { return new ArrayList(new Text(128)); }, 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions).')
->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.') // TODO add our own built-in confirm page
->action(
- function ($teamId, $email, $name, $roles, $url) use ($response, $register, $project, $user, $audit, $projectDB, $mode) {
+ function ($teamId, $email, $name, $roles, $url) use ($response, $mail, $project, $user, $audit, $projectDB, $mode) {
$name = (empty($name)) ? $email : $name;
$team = $projectDB->getDocument($teamId);
@@ -323,29 +323,36 @@ $utopia->post('/v1/teams/:teamId/memberships')
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['inviteId' => $membership->getId(), 'teamId' => $team->getId(), 'userId' => $invitee->getId(), 'secret' => $secret, 'teamId' => $teamId]);
$url = Template::unParseURL($url);
- $body = new Template(__DIR__.'/../../config/locales/templates/'.Locale::getText('account.emails.invitation.body'));
+ $body = new Template(__DIR__.'/../../config/locales/templates/_base.tpl');
+ $content = new Template(__DIR__.'/../../config/locales/templates/'.Locale::getText('account.emails.invitation.body'));
+ $cta = new Template(__DIR__.'/../../config/locales/templates/_cta.tpl');
+
$body
+ ->setParam('{{content}}', $content->render())
+ ->setParam('{{cta}}', $cta->render())
+ ->setParam('{{title}}', Locale::getText('account.emails.invitation.title'))
->setParam('{{direction}}', Locale::getText('settings.direction'))
->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]']))
->setParam('{{team}}', $team->getAttribute('name', '[TEAM-NAME]'))
->setParam('{{owner}}', $user->getAttribute('name', ''))
->setParam('{{redirect}}', $url)
+ ->setParam('{{bg-body}}', '#f6f6f6')
+ ->setParam('{{bg-content}}', '#ffffff')
+ ->setParam('{{bg-cta}}', '#3498db')
+ ->setParam('{{bg-cta-hover}}', '#34495e')
+ ->setParam('{{text-content}}', '#000000')
+ ->setParam('{{text-cta}}', '#ffffff')
;
- $mail = $register->get('smtp'); /* @var $mail \PHPMailer\PHPMailer\PHPMailer */
-
- $mail->addAddress($email, $name);
-
- $mail->Subject = sprintf(Locale::getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]']));
- $mail->Body = $body->render();
- $mail->AltBody = strip_tags($body->render());
-
- try {
- if(APP_MODE_ADMIN !== $mode) { // No need in comfirmation when in admin mode
- $mail->send();
- }
- } catch (\Exception $error) {
- throw new Exception('Error sending mail: ' . $error->getMessage(), 500);
+ if(APP_MODE_ADMIN !== $mode) { // No need in comfirmation when in admin mode
+ $mail
+ ->setParam('event', 'teams.membership.create')
+ ->setParam('recipient', $email)
+ ->setParam('name', $name)
+ ->setParam('subject', sprintf(Locale::getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]'])))
+ ->setParam('body', $body->render())
+ ->trigger();
+ ;
}
$audit
diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php
index d90966ba72..ff59b03072 100644
--- a/app/controllers/web/console.php
+++ b/app/controllers/web/console.php
@@ -14,6 +14,7 @@ use Appwrite\Storage\Storage;
$utopia->init(function () use ($layout) {
$layout
+ ->setParam('description', 'Appwrite Console allows you to easily manage, monitor, and control your entire backend API and tools.')
->setParam('analytics', 'UA-26264668-5')
;
});
diff --git a/app/init.php b/app/init.php
index 62508f44df..8b8f8b3e0e 100644
--- a/app/init.php
+++ b/app/init.php
@@ -149,6 +149,7 @@ $register->set('smtp', function () use ($request) {
$mail->Password = $password;
$mail->SMTPSecure = $request->getServer('_APP_SMTP_SECURE', false);
$mail->SMTPAutoTLS = false;
+ $mail->CharSet = 'UTF-8';
$from = urldecode($request->getServer('_APP_SYSTEM_EMAIL_NAME', APP_NAME.' Server'));
$email = $request->getServer('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM);
diff --git a/app/views/console/comps/footer.phtml b/app/views/console/comps/footer.phtml
index e8f7770d6f..26493f30cb 100644
--- a/app/views/console/comps/footer.phtml
+++ b/app/views/console/comps/footer.phtml
@@ -5,25 +5,25 @@ $version = $this->getParam('version', '').'.'.APP_CACHE_BUSTER;