[coldbox-3.8.1] MailPlugin and getting the final rendering

I have a client that employs an email notification tracking table and they want to dump system generated email messages to a table associated with the target user they were delivered to. My initial problem is I can get the pre-rendered version (before the mail is sent) but I assume that the final render (using body tokens) is done at send time. I need to store THAT render in the database.

Has anyone had to do this before and know of the best way to get that final rendering? .Send only returns back a struct of error information (if one occur).

Mike

Mike,

There needs to be more information, when you say render what do you mean by
that. Are you using views intended for the client to send as emails? That
is not a practical way to go about it, personally I would store templates
in the DB or disk for the email.

Have a gander at ConetnBox, even though it use hard coded templates to do
this, you could very easily switch to using the CMS to generate custom
templates to use to send out.

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/
Google+: http://plus.google.com/113032480415921517411

Mike,
Kludgy, but you can copy a BCC address and process all emails received on that address and store into tables…

“Yes, I’m THAT kind of hacker!”

Mike,

I think I see what you’re trying to do, maybe not over thinking this might help.

What I though would maybe be a better over all solution, would be at the time the email is created and prior to sending although it probably will not matter, you could do this.

mailData = myMail.getMemento();

This will return everything from the mail bean, which is technically a snapshot of everything that is in the email. If you need to keep this information. then store that into the DB. Then when you want to re-send an email. you can pull that information up create a new mail object and use the setMemento() and you can then use the send() method.

Is that what you’re looking at achieving?