Working with campaign templates programmatically
The topic describes how to work with marketing automation campaign templates programmatically.
Campaign templates are managed by the Sitecore.Marketing.Automation.Definitions.AutomationCampaignTemplates.AutomationCampaignTemplateDefinitionManager class. They are stored in the master database under the following path: */sitecore/system/Marketing Control Panel/Marketing Automation Templates*
Access the automation campaign template manager
The AutomationCampaignTemplateDefinitionManager is available from the Sitecore DI container.
Constructor injection
Service locator
Define an automation campaign template
Automation campaign templates and automation campaigns share the same structure and implement the IAutomationPlanDefinition. For more info, see Automation plans.
Save an automation campaign template
Update an existing automation campaign template
Delete an automation campaign template
Retrieve an automation campaign template
Retrieve an automation campaign template using an alias
Retrieve all automation campaign templates
You cannot activate an automation campaign template programatically. If the ActivateAsync method of the AutomationCampaignTemplateDefinitionManager is called, or if SaveAsync is called and the activate parameter is set to true, a NotSupportedException occurs.