sending email stored in DB
Posted: Thu Jul 09, 2009 4:00 pm
Hi!
Today I started using swiftmailer with symfony and it looks very sexy; it's a Greate lib. But I have the following problem:
I am developing a webapp in symfony. And now I want to add a tell a friend form. My idea was to generate the email when the form is submitted and to safe it in the db.
In a cronjob I want to take the entry from the db and send it. Firstly I thought I can serialize the message object to put it in the db.
In the cronjob I wanted to unserialize the object, but this doesn't work.
Secondly I had the idea to store the mail source code retrieved from Swift_Message::toString() in the db. But now I see no way to send this source code. I see no way to give the finished mail source code to the Swift_Mailer object or to the Swift_Message object.
I want to store the finished email in the db because there are several places in my app which generate different mails. So I don't want to store the email fields(from, to, subject, ...) in the db.
Thankful for every hint,
misch
Today I started using swiftmailer with symfony and it looks very sexy; it's a Greate lib. But I have the following problem:
I am developing a webapp in symfony. And now I want to add a tell a friend form. My idea was to generate the email when the form is submitted and to safe it in the db.
In a cronjob I want to take the entry from the db and send it. Firstly I thought I can serialize the message object to put it in the db.
In the cronjob I wanted to unserialize the object, but this doesn't work.
Secondly I had the idea to store the mail source code retrieved from Swift_Message::toString() in the db. But now I see no way to send this source code. I see no way to give the finished mail source code to the Swift_Mailer object or to the Swift_Message object.
I want to store the finished email in the db because there are several places in my app which generate different mails. So I don't want to store the email fields(from, to, subject, ...) in the db.
Thankful for every hint,
misch