I have a web application that sends out transactional (triggered) emails to users. We've setup a message queue for the web application to write to when it needs to send out an email (best practices reasons etc.).
The question I'm struggling with is when to have the email template parsed into text:
Parse the template and place the entire email body into the queue
- Pro: can keep the business logic and template close by
- Con: more data over the wire to the queue (email body vs email type/ids etc.)
Parse the template as part of the queue processing (before it's sent to the transactional email service)
- Pro: less data over the wire to the queue, less processing on the messaging logic
- Con: queue processor needs to have business logic
I like option #1 because I don't see data over wire ever getting too big and keeping the email logic in a central location makes more logical sense from a development standpoint.
Is there a best practice in this situation?