The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Swiftmailer mod for 'return-path' - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Modules (https://forums.formtools.org/forumdisplay.php?fid=16)
+--- Thread: Swiftmailer mod for 'return-path' (/showthread.php?tid=107)



Swiftmailer mod for 'return-path' - Chuck - Apr 4th, 2009

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

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


RE: Swiftmailer mod for 'return-path' - Ben - Apr 5th, 2009

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


RE: Swiftmailer mod for 'return-path' - Chuck - Apr 5th, 2009

(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!


RE: Swiftmailer mod for 'return-path' - Ben - Apr 9th, 2009

Hey Chuck,

I really liked your idea for this, so I've added it to the main core script.

See the documentation here:
http://modules.formtools.org/swift_mailer/documentation.php?page=undeliverable_emails

Basically, a new field shows up on your Edit Email Template » Recipient tab, labeled "Undeliverable Email Recipient", where you can enter a custom email recipient for each email template.

Note: it WILL require you to be running the latest version of the Form Tools Core, too. So when upgrading, just select both the Core + the Swift Mailer module.

Enjoy!

- Ben


RE: Swiftmailer mod for 'return-path' - Chuck - Apr 9th, 2009

(Apr 9th, 2009, 5:11 PM)Ben Wrote: See the documentation here:
http://modules.formtools.org/swift_mailer/documentation.php?page=undeliverable_emails

Sweet! Thanks Ben!

Just a note to others on the upgrade. After downloading the upgrade code and installing it onto my site I had to visit the Modules section and click on the Upgrade link for Swiftmailer. No big deal but if you don't take this step the new functionality won't be active.


RE: Swiftmailer mod for 'return-path' - Ben - Apr 9th, 2009

Good point - thanks for mentioning that.


RE: Swiftmailer mod for 'return-path' - esmoke - Apr 17th, 2011

Thanks for posting your solution