You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that queueing works by serializing and unserializing whole swift mailer message object.
If the message object is set for posting into long future and in the meantime with some upgrade the swiftmailer message object changes, then unserializing will fail.
It would be much safer to store email as a binary text without unserializing - separate headers and body. Unserializing is not only error prone, but also stores bunch of useless object data (with swift message are also serialized other related in-memory swift objects).
We have customers who wants to send email reminder for example next year. With serializing/unserializing we could not do any safe upgrade of swift mailer until last email posted.
Unlike swift mailer, PHP mailer exposes two methods PreSend and PostSend. First one allows fetching separate headers & body as a binary text suitable to async post:
if($mail->PreSend()){
// no serialized objects, just binary texts:
$modelMail->header = $mail->getMIMEHeader();
$modelMail->body = $mail->getMIMEBody();
$modelMail->save();
}
Then next year without any dependency on mailer related objects we can just pull data from DB & post:
That's why we cannot use swiftmailer, it's not suitable for queueing unlike PHPMailer - there is no method to store separately headers & body as a binary text in swift mailer.
The text was updated successfully, but these errors were encountered:
Hi,
I understand that queueing works by serializing and unserializing whole swift mailer
message object
.If the
message object
is set for posting into long future and in the meantime with some upgrade the swiftmailermessage object
changes, then unserializing will fail.It would be much safer to store email as a binary text without unserializing - separate headers and body. Unserializing is not only error prone, but also stores bunch of useless object data (with swift message are also serialized other related in-memory swift objects).
We have customers who wants to send email reminder for example next year. With serializing/unserializing we could not do any safe upgrade of swift mailer until last email posted.
Unlike swift mailer, PHP mailer exposes two methods PreSend and PostSend. First one allows fetching separate headers & body as a binary text suitable to async post:
Then next year without any dependency on mailer related objects we can just pull data from DB & post:
That's why we cannot use swiftmailer, it's not suitable for queueing unlike PHPMailer - there is no method to store separately headers & body as a binary text in swift mailer.
The text was updated successfully, but these errors were encountered: