Has anyone implemented the List-Unsubscribe & List-Unsubscribe-Post headers using swiftmailer ?
I know how to insert headers ...
$_headers = $message->getHeaders();
$_headers->addTextHeader( 'List-Unsubscribe', $list_unsubscribe );
if ( $has_dkim ) $_headers->addTextHeader( 'List-Unsubscribe-Post', 'List-Unsubscribe=One-Click' );
$list_unsubscribe
variable may contain one <url> and/or one <mailto>
1st problem : Whatever the order of List-Unsubscribe and List-Unsubscribe-Post headers are set, they always appear in the wrong order (List-Unsubscribe-Post before List-Unsubscribe).
I tried to change header ordering using method defineOrdering
, but that did not work as intended.
I even tried to hack the swiftmailer code to append those two new headers to the existing order list ... but did not work !
2nd problem : Would appreciate any hint on how to encode properly these two <url> & <mailto> using swiftmailer toolbox (i am also using the Decorator plugin).
Thank you for your answers.
So, 1st problem is solved !
According to RFC 5322