FEATURE REQUEST: email template headers
It would be useful to add additional optional headers to the email templates such as CC, BCC and Reply-To
From the forums there appears to be some demand for this functionality.
I have set up my app to send all transactional email through mandrill which works extremely well. Currently when someone signs up via the membership plug in, an email is sent to the user with their password. I have also added a call to send a message to admin that a new user has been added. I would like to set the "reply to" header to be the user's email. Using the users email in the from address when using mandrill works but impacts sending domain validation.
Where do you want to add reply-to? To the default signup message or to your custom admin message that you added?
There's no functionality in the plugin for it but there is functionality in the internal sendMessage function in /lib/common.php as you can see in the function header in that file:
// Full Featured Example:
$errors = sendMessage(array(
'from' => "email@example.com",
'to' => "firstname.lastname@example.org",
'subject' => "Enter subject here, supports utf-8 content",
'text' => "Text message content",
'html' => "<b>HTML</b> message content",
'headers' => array(
"CC" => "email@example.com",
"BCC" => "firstname.lastname@example.org",
"Reply-To" => "email@example.com",
"Return-Path" => "firstname.lastname@example.org",
'attachments' => array(
'simple.txt' => 'A simple text file',
'dynamic.csv' => $csvData,
'archive.zip' => $binaryData,
'image.jpg' => file_get_contents($imagePath),
//'disabled' => false, // set to true to disable sending of message
//'logging' => false, // set to false to disable logging (if logging is already enabled) - used for background mailers
So you might be able to add it by adding a 'headers' => array('Reply-To' => $email), field.
Hope that helps!
Ok, the issue we don't want to add too many fields, or we end up with something that isn't any more simple than a programming language. So most of what we do design wise is try to limit it to what's absolutely essential.
But as you say, with sending domain validation it can become an issue. I'm wondering if it even makes sense being able to specify a different from: email for each template.
In any case, what fields do you want added? Reply-to, CC, and BCC? To the "Email Templates" section, correct? I'll see what I can come up with for that.
I understand your concern about added fields.
Since as a general rule emails will/should always be from admin, I would agree that FROM might be unnecessary. CC or BCC might of use to some, but I prefer using a different email to admin than a copy of the one to the user.
I find it practical to add a second call to send an mail using a different template to admin (which I discovered needs to be before the one to user) .
REPLY TO does not impact the original email destination but could very well be different for each email for a reply.
FROM admin, TO user REPLY TO [sales|billing|support]
FROM admin TO admin REPLY TO user