Apr 4th, 2009, 6:01 PM
I left a post in the Form Tools / Modules / Other / Swiftmailer / Feature Requests thread asking for access to the header 'return-path' value for email. In the meantime I have a mod in place that puts a single email address into all Swiftmailer generated email for both text and html formats. The script I altered was:
formtools/modules/swift_mailer/library.php
This places the same return-path email on top of all email generated by Swiftmailer. I hope this helps others looking for a similar solution. Maybe this can make the official list as a feature request.
Enjoy!
Chuck
formtools/modules/swift_mailer/library.php
Code:
// now send the appropriate email
if (!empty($email_components["text_content"]) && !empty($email_components["html_content"]))
{
$email =& new Swift_Message($email_components["subject"]);
$email->attach(new Swift_Message_Part($email_components["text_content"]));
$email->attach(new Swift_Message_Part($email_components["html_content"], "text/html"));
}
else if (!empty($email_components["text_content"]))
{
$email =& new Swift_Message($email_components["subject"]);
$email->setReturnPath('webmaster@example.com'); // THIS IS 1 of 2 NEW LINES
$email->attach(new Swift_Message_Part($email_components["text_content"]));
}
else if (!empty($email_components["html_content"]))
{
$email =& new Swift_Message($email_components["subject"]);
$email->setReturnPath('webmaster@example.com'); // THIS IS 2 of 2 NEW LINES
$email->attach(new Swift_Message_Part($email_components["html_content"], "text/html"));
}
This places the same return-path email on top of all email generated by Swiftmailer. I hope this helps others looking for a similar solution. Maybe this can make the official list as a feature request.
Enjoy!
Chuck