I'm trying to add a Reply-To header in a hook_mail_alter(), like so:
/**
* Implements hook_mail_alter().
*/
function my_module_mail_alter(&$message) {
$message['headers']['Reply-To'] = $message['from'];
// $message['from'] = // something else here
}
However, in smtp.mail.inc it's only adding the Reply-To header if it differs from the Return-Path header. This causes problems later, because my SMTP connection is to SendGrid, which adds it's own Return-Path header. Thus, there's no way to add a Reply-To header.
For a good explanation of the difference between these two headers, see here:
https://stackoverflow.com/q/1235534
We should add it unconditionally, if it's defined.
Comments
Comment #2
joelstein commentedComment #3
dinesh18 commentedYes, you are correct. It should be unconditionally.
+1 to RTBC
Comment #4
chris matthews commentedComment #5
wundo commentedI agree with @dinished18
Comment #6
wundo commentedComment #7
wundo commented