I have a custom action class that inherits ContactAutomationAction. This action triggers when the activity Purchase is created for the Contact. In the override Execute() I get the Contact object then I get the Contact.LastActivity value. If the LastActivity value is “purchase” the code will sent out email using a template from Kentico API.
Problem: If the Contact(aka user) moves to another page the LastActivity value will never be “purchase”.
Question: How do I get the Purchase Activity that trigger the Action in Steps from Kentico. I was thinking the last Purchase activity, but the User could went back in order during the 5 day delay in steps.
I ended up with this solution here. Does anyone have a better one?
var lastPurchaseActivity = ActivityInfoProvider.GetContactsLastActivity(Contact.ContactID, "Purchase");
Thanks David
Please, sign in to be able to submit a new answer.