Skip to content

Commit

Permalink
Override sender domain inside From:
Browse files Browse the repository at this point in the history
  • Loading branch information
ppavlovic committed Sep 13, 2021
1 parent accc270 commit e9d1c97
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ public function getLogId()
return $this->logId ?: null;
}

public function overrideSenderDomain($senderDomain)
{
if (empty($senderDomain)) {
return;
}
$this->from = preg_replace(
'/([^<]*)<([^@]*)@([^>]*)>/',
'$1<$2@' . $senderDomain . '>',
$this->from
);
}

/**
* @param array $options Array of email or href that is used to unsubscribe user
*/
Expand Down

0 comments on commit e9d1c97

Please sign in to comment.