Skip to content

Commit

Permalink
Merge pull request #30491 from herbdool/core-5301
Browse files Browse the repository at this point in the history
dev/core#5301 Allow Reply-To and From to be set directly
  • Loading branch information
mattwire authored Aug 26, 2024
2 parents 5b253eb + 0e51729 commit 4e97a04
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CRM/Utils/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ public static function setEmailHeaders($params): array {
if (!empty($params['headers'])) {
$headers = array_merge($headers, $params['headers']);
}
$headers['From'] = $params['from'];
// dev/core#5301: Allow From to be set directly.
$headers['From'] = $params['From'] ?? $params['from'];
$headers['To'] = self::formatRFC822Email(
$params['toName'] ?? NULL,
$params['toEmail'] ?? NULL,
Expand All @@ -344,7 +345,8 @@ public static function setEmailHeaders($params): array {
$headers['Return-Path'] = $params['returnPath'] ?? $defaultReturnPath;

// CRM-11295: Omit reply-to headers if empty; this avoids issues with overzealous mailservers
$replyTo = ($params['replyTo'] ?? ($params['from'] ?? NULL));
// dev/core#5301: Allow Reply-To to be set directly.
$replyTo = $params['Reply-To'] ?? ($params['replyTo'] ?? ($params['from'] ?? NULL));

if (!empty($replyTo)) {
$headers['Reply-To'] = $replyTo;
Expand Down

0 comments on commit 4e97a04

Please sign in to comment.