Skip to content

Commit

Permalink
Merge pull request #10251 from creative-commoners/pulls/4/exthook
Browse files Browse the repository at this point in the history
API Add extension hook for email default from
  • Loading branch information
michalkleiner authored Mar 8, 2022
2 parents 09fdfc4 + b73a3cd commit 7d8ea82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
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

0 comments on commit 7d8ea82

Please sign in to comment.