Skip to content

Commit

Permalink
Fall back to ##admin_email## automatically if not defined otherwise a…
Browse files Browse the repository at this point in the history
…s it used to be in v1
  • Loading branch information
Toflar committed May 8, 2024
1 parent ba534a3 commit 2a93f1f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Gateway/MailerGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ private function createEmailStamp(Parcel $parcel): EmailStamp
$stamp = $stamp->withTo($this->replaceTokensAndInsertTags($parcel, $languageConfig->getString('recipients')));
$stamp = $stamp->withSubject($this->replaceTokensAndInsertTags($parcel, $languageConfig->getString('email_subject')));

if ('' !== ($from = $this->replaceTokensAndInsertTags($parcel, $languageConfig->getString('email_sender_address')))) {
// Automatically fall back to ##admin_email## if no sender was configured. In
// case this token does not exist either, it will result in the same error as not
// supplying a sender address at all.
$from = '' !== $languageConfig->getString('email_sender_address') ? $languageConfig->getString('email_sender_address') : '##admin_email##';

if ('' !== ($from = $this->replaceTokensAndInsertTags($parcel, $from))) {
$stamp = $stamp->withFrom($from);
}

Expand Down

0 comments on commit 2a93f1f

Please sign in to comment.