1

I tried to create Sitecore custom activity which appears on the Marketing automation control panel UI but does not call the invoke method when I pass the send sms service to it. If the invoke method does not have any services inside and only works with facets data (for example, retrieves contacts e-mail) the invoke method is being called and the action passes the campaign. Any ideas what could be wrong? I used sitecore.docs marketing automation documentation (https://doc.sitecore.com/developers/91/sitecore-experience-platform/en/create-an-activity-type.html) for this. Thank you in advance!

2 Answers 2

1

The Marketing Automation Engine supports constructor dependency injection for custom activities. So to use a dependency in your custom activity, add a parameter to the constructor of your custom activity matching the type of the service you want passed in:

public class SymposiumReminder : IActivity
{
    private IOtherService _otherService;

    public SymposiumReminder(IOtherService otherService)
    {
        _otherService = otherService;
    }

    public ActivityResult Invoke(IContactProcessingContext context)
    {
    }
}

Also, make sure your dependency is available and has been registered to the Marketing Automation Engine application.

0

The problem was with the third party service DLL, it had to be copied to Automation engine folder.

1
  • Please add more clarity to this answer Commented Aug 14, 2019 at 9:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.