diff --git a/CHANGES.md b/CHANGES.md index b19d711731..d8e177b252 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,7 @@ * Upgraded MariaDB image to version 1.0.2 * Upgraded SMTP image to version 1.0.1 * File upload route (POST /v1/storage/files) now accept a single file per request +* Added ENV vars to change system email sender name and address ## Bug Fixes diff --git a/app/init.php b/app/init.php index af9179c4b5..e6f9a85211 100644 --- a/app/init.php +++ b/app/init.php @@ -124,8 +124,11 @@ $register->set('smtp', function () use ($request) { $mail->SMTPSecure = $request->getServer('_APP_SMTP_SECURE', false); $mail->SMTPAutoTLS = false; - $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