Skip to content

Commit

Permalink
dev/core#5301 Allow Reply-To and From to be set directly
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdool authored Jun 18, 2024
1 parent ecac570 commit 0e51729
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 0e51729

Please sign in to comment.