Marketing Automation API for Commerce campaigns
The Automation Provider is generic for all marketing automation campaigns and encompasses the following functionality:
-
Creation of a Abandoned Cart marketing automation campaign based on an existing template.
-
Creation of a New Order Placed marketing automation campaign based on an existing template.
-
Contact enrollment into automation campaigns.
-
Contact removal from automation campaigns.
The following class diagram shows the relationship between the IAutomationProvider
and the AutomationProvider
and lists the methods they contain.
Methods
The table below lists the methods available for the Automation Provider.
Method |
Description |
---|---|
|
Creates a marketing automation campaign based on a template.
The resulting campaign name is: shopName + “ “ + templateName. Important For Commerce marketing automation campaigns, you must adhere to the naming convention shopName + “ “ + templateName.
|
|
Enrolls the current contact into the plan.
This method is called, for example, whenever a contact interacts with the cart on the shopping site to enroll them into Commerce marketing automation campaigns. |
|
Removes the contact from the current plan. For example, when the shopping cart is submitted and turned into an order, this method is called to remove the contact from the abandoned cart campaign. |
|
Removes the current contact from the given plan. |
The default implementation is dynamically loaded based on the following configuration.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<automationProvider type="Sitecore.Commerce.MarketingAutomation.Providers.AutomationProvider, Sitecore.Commerce.Connect.MarketingAutomation" singleInstance="true"/>
</sitecore>
</configuration>
To extend the current implementation, you can implement the IAutomationProvider
interface and change the above configuration.
Automation Plan Provider
The Automation Plan Provider is responsible for returning the plan for the current storefront:
The following table details the methods available.
Method |
Description |
---|---|
|
Returns the automation plan based on the given |
The default implementation is dynamically loaded based on the following configuration.
Sitecore.Commerce.MarketingAutomation.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<automationPlanProvider type="Sitecore.Commerce.MarketingAutomation.Providers.AutomationPlanProvider, Sitecore.Commerce.Connect.MarketingAutomation" singleInstance="true"/>
</sitecore>
</configuration>
To extend the current implementation, you can implement the IAutomationPlanProvider
interface and change the above configuration.
Automation Plan Custom Value Providers
These Custom Value providers deliver additional information that is part of the campaign state when enrolled into a plan. Currently, a version for Cart and Orders are available. These are the values passed into the customValues
of the EnrollCurrentContact
method of the IAutomationProvider
interface.
The following table lists the methods available.
Method |
Description |
---|---|
|
The arguments of the called pipeline are passed as an input parameter to the method. For carts, by default, the following information is returned:
For orders, by default, the following information is returned:
The Send Commerce Email marketing automation campaign activity uses the custom values to pass information to the email rendering so that the rendering can extract cart information to be part of the marketing automation campaign email. Important For Commerce marketing automation campaigns, do not use the Send Email action. |