I was working with Sitecore EXM couple of months ago and we were heavily customizing it. I was not blogging at that time therefore knowledge gathered during this time is only in my head 🙂
Recently, I stumbled upon a question on Sitecore Stack Exchange where I instantly remembered similar issue we were solving back then.
You are customizing DispatchTask or some of the pipelines called during dispatching email campaign and you want to test it out.
Sitecore EXM has a nice functionality for that and you can send quick test from “Review” Tab:
When you do that, you quickly realize that your custom DispatchTask is not hit and also some pipelines are magically skipped.
Problem is that for “Send quick test” functionality DispatchNewsletter pipeline or manager is using SendTestMessage and therefore TestMessageTask is called instead of your custom DispatchTask. Also some of the pipelines are just skipped in this scenario.
The only solution for this problem that I am aware is to simply create “dummy” contact list only with one recipient. This recipient will be your “test” recipient and add that contact list into Included recipient lists in “Recipients” tab. Send this campaign normally. If all is fine you are duplicate it and make scheduled or automated campaigned out of it by duplicating or by just configuring campaign in “Delivary” tab.