There are a few ways to do this, and @bogdan.nastase suggested a good one: using a Dispatcher and a Performer.
The problem is that currently the contents of queue items need to be serializable into a JSON string, and MailMessage
is not (you can test by calling MyEmailMessage.GetType().IsSerializable
).
Two alternatives are:
- Implement a way to serialize it yourself. This might be a good thing to be wrapped into a custom activity and submitted to the Hackaton. Anyone up for the challenge?
- Get the information you want from the email (e.g., date, sender, subject) and save them in queue items. Sample workflows for this approach: REFrameworkWithEmails-Dispatcher.zip (497.6 KB) REFrameworkWithEmails-Performer.zip (495.6 KB)
About @yashaswiniGowda’s question: They can be useful not only to deal with volume, but also for easier maintenance and more flexibility; so I would say yes!