Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Extension hook for email default from #10251

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/en/02_Developer_Guides/10_Email/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/Control/Email/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ private function getDefaultFrom(): string
}
$defaultFrom = sprintf('no-reply@%s', $host);
}
$this->extend('updateDefaultFrom', $defaultFrom);
return $defaultFrom;
}

Expand Down