API Extension hook for email default from

This commit is contained in:
Steve Boyd 2022-03-08 14:31:51 +13:00
parent 09fdfc4611
commit b73a3cdd7a
2 changed files with 3 additions and 0 deletions

View File

@ -215,6 +215,8 @@ email marked as spam. If you want to send from another address think about using
You will also have to remove the `SS_SEND_ALL_EMAILS_FROM` environment variable if it is present.
If you need greater control over this email address, for instance if are running the subsites modules, you can implement the `SilverStripe\Control\Email\Email::updateDefaultFrom()` extension hook.
## Redirecting Emails
There are several other [configuration settings](/developer_guides/configuration) to manipulate the email server.

View File

@ -297,6 +297,7 @@ class Email extends ViewableData
}
$defaultFrom = sprintf('no-reply@%s', $host);
}
$this->extend('updateDefaultFrom', $defaultFrom);
return $defaultFrom;
}