Developing Custom Marketing Automation Actions

David Pearson asked on September 21, 2016 19:15

I am working on the docs page: Documentation Page for Custom actions

I am attempting to Register actions in the system at the bottom of the page.

I created the custom action class name DriftMail (store in App_Code/Marketing/DriftEmail) that inherits CMS.OnlineMarketing.ContactAutomationAction. Also set up the override Execute and added [assembly: RegisterCustomClass("DriftEmail", typeof(DriftEmail))] just below the using statements.

When I attempted to register the new actions in Marketing Automation I run into issues of what to select in the Action Configurations. I selected CMS.Automation for the Assembly name.

What do I use for the class name? I am getting Bad Assembly or Class Name selected. Did I miss a step?

Recent Answers

David Pearson answered on September 21, 2016 19:44

I got the Register the New Action piece out of the way by moving the class to the root of app_code folder.

Is there way I can reference the location of the class like "App_Code/Folder1/Folder2/ClassFolder/classname"?

Thanks David

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on September 21, 2016 21:11

Sounds like you're missing an attribute on the class.

In the instructions, when you define your API class, you are suppose to put this attribute:

[assembly: RegisterCustomClass("MyClassName", typeof(CustomClass))]

Did you perform this step? You may need to call a different "Register" method other than "RegisterCustomClass" as well, but i believe that should be the issue.

1 votesVote for this answer Mark as a Correct answer

David Pearson answered on September 22, 2016 15:28

Yes I did add the attribute: [assembly: RegisterCustomClass("DriftEmail", typeof(DriftEmail))]

The class did register, I found I have to put the class in the root of App_Code folder to get to work. Also had the same issue with the Custom Email Provider. Will mess around with the paths again today.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.