I'm using the Drupal 7 Rules module to trigger and send emails on specific events, but need to modify the email headers before the message is sent.
What would be the appropriate way to add 'reply-to' headers (as used in RFC 5322) to specific outgoing emails that are sent using the Drupal 7 Rules module?
The following works when using drupal_mail() but I do not see how to apply this hook when using Rules.
function hook_mail($key, &$message, $params) {
switch ($key) {
case 'key_name_here':
$message['Reply-to'] = $params['mail'];
$message['subject'] = $params['subject'];
$message['body'] = $params['body'];
$message['headers']['Reply-To'] = $params['mail'];
break;
}
}
// One note to the above script, lines 4 and 7 seem redundant and likely need work.