I'm writing a custom marketing automation action which will be triggered by submission of a bizform. My action class can implement CMS.OnlineMarketing.ContactAutomationAction in order to access the contact details from my Execute() method, but I'd also like to access the content of the submitted form.
Can anyone suggest the best approach?
I know activities have ActivityItemID and ActivityItemDetailID properties which would allow me to access the form data, but I can't see the best way to access the details of the activity which triggered the automation task.
I've just discovered the LastActivity property of ContactInfo which might be what I'm looking for. But given the asynchronous nature of marketing automation, can I be confident that this will always hold the bizform submission activity (assuming the only trigger is a bizform submission)?
You are correct on the LastActivity property. Check out the bottom of my blog post on Kentico Marketing Automation I talk about it a bit.
If you don't mind dropping into the code though, the best thing to do would be to use a Trigger Event Handler. That way you could set the fom submission data as a macro source and know for sure.
Thanks Brian, this is really helpful.
Please, sign in to be able to submit a new answer.