From 0192041a17590731438fa22f8204476268748ba5 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 8 Feb 2020 01:19:13 +0200 Subject: [PATCH 1/2] Added env vars to change system email sender name and address --- app/init.php | 7 +++++-- docs/tutorials/environment-variables.md | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/init.php b/app/init.php index aff5f795e4..d9289d0a4a 100644 --- a/app/init.php +++ b/app/init.php @@ -123,8 +123,11 @@ $register->set('smtp', function () use ($request) { $mail->Password = $password; $mail->SMTPSecure = $request->getServer('_APP_SMTP_SECURE', ''); - $mail->setFrom('team@appwrite.io', APP_NAME.' Team'); - $mail->addReplyTo('team@appwrite.io', APP_NAME.' Team'); + $from = $request->getServer('_APP_SYSTEM_EMAIL_NAME', APP_NAME.' Team'); + $email = $request->getServer('_APP_SYSTEM_EMAIL_ADDRESS', 'team@appwrite.io'); + + $mail->setFrom($email, $from); + $mail->addReplyTo($email, $from); $mail->isHTML(true); diff --git a/docs/tutorials/environment-variables.md b/docs/tutorials/environment-variables.md index 842601a614..ffa9300bea 100644 --- a/docs/tutorials/environment-variables.md +++ b/docs/tutorials/environment-variables.md @@ -117,3 +117,13 @@ SMTP server user name. Empty by default. ### _APP_SMTP_PASSWORD SMTP server user password. Empty by default. + +## System Settings + +### _APP_SYSTEM_EMAIL_NAME + +This is the sender name value that will appear on email messages sent to developers from the Appwrite console. The default value is: 'Appwrite Team'. + +### _APP_SYSTEM_EMAIL_ADDRESS + +This is the sender email address that will appear on email messages sent to developers from the Appwrite console. The default value is 'team@appwrite.io'. You should choose an email address that is allowed to be used from your SMTP server to avoid the server email ending in the users' SPAM folders. \ No newline at end of file From 2d4aaa2aa4d9ee1e74df9330e76b0d29fd9646fe Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 8 Feb 2020 01:19:56 +0200 Subject: [PATCH 2/2] Updated changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 104e1293c2..3d775c73e4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ * New database rule validation options * Update docs example with auth info * Allow non-web platform skip origin header +* Added ENV vars to change system email sender name and address ## Bug Fixes