Apr 5th, 2009, 9:47 PM
(Apr 5th, 2009, 9:02 PM)Ben Wrote: This is terrific! Thanks for posting your solution, Chuck.
I'll definitely keep this in mind for future versions of the Swift Mailer module. What I'll probably do is make this a configurable option on the Edit Template page so users can enter it there.
- Ben
I'm not completly sure but you might want to consider adding a third line for the emails that have attachments:
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->setReturnPath('webmaster@example.com'); // ADDITIONAL THIRD NEW LINE
$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"));
}
I haven't tested the third line but it looks like it should work.
Thank you Ben!