Install
This section contains installation instructions for the Litium Voyado Connector.
Prerequisites
Litium 6.x, where x is the latest service release.
Set up a Litium.AddOns.VoyadoConnector project
- Download the zip package from Litium AddOns.
- Unzip and copy the Litium.AddOns.VoyadoConnector folder into your solutions folder.
- Rename app.config.sample to app.config. If you are upgrading, make sure you have a backup so values can be copied from it.
- Add the Litium.AddOns.VoyadoConnector project into your solution, and add a project reference from it to Litium.Accelerator.MVC project, so that output DLLs will be copied to wwwroot/bin when building.
- Add NuGet packages Litium.AddOns.MarketingAutomation to your Litium.Accelerator.MVC project. This will also add Litium.AddOns.MarketingAutomation.Abstractions.
- Add NuGet packages Litium.AddOns.MarketingAutomation.Abstractions to your Litium.Accelerator project.
Configure feed folder
- In files folder (or files folder if you do not have common files), create a sub folder called Voyado.
Configure accelerator state transitions
In src\Litium.Accelerator\StateTransition\OrderStateBuilder.cs, register the MarketingAutomation RegisterOrderStateChanged event when the order is Confirmed and Completed. You may also add to any other states if they are set up in Voyado tenant.
The following is sample code on how the event is added to Confirmed state. You would need following using statement, using Litium.AddOns.MarketingAutomation.Abstractions;
//Order Confirmed
var confirmed = new State<OrderCarrier>((short)OrderState.Confirmed, OrderState.Confirmed.ToString(),
(orderCarrier, currentState, token) =>
{
//Order confirmed entry action.
//now the order is confirmed, reduce the stock balances.
OrderUtilities.ReduceStockBalance(ModuleECommerce.Instance.Orders[orderCarrier.ID, token], ModuleECommerce.Instance.AdminToken);
//notify campaigns engine to take order confirmation actions.
ModuleECommerce.Instance.CampaignCalculator.HandleOrderConfirmation(orderCarrier, ModuleECommerce.Instance.AdminToken);
//Send order confirmation email.
IoC.Resolve<IMailService>().SendEmail(new OrderConfirmationEmail(orderCarrier.ID, orderCarrier.CustomerInfo.Address.Email, orderCarrier.WebSiteID), false);
//Marketing automation integration code to execute when an order is confirmed.
IoC.Resolve<MarketingAutomationService>().RegisterOrderStateChanged(orderCarrier.ID);
},
null);
Add to the order completed event as well, and any other event that you would want marketing automation flows.
//Order Completed: All tasks relating to order is completed.
var completed = new State<OrderCarrier>((short)OrderState.Completed, OrderState.Completed.ToString(),
(orderCarrier, currentState, token) =>
{
IoC.Resolve<MarketingAutomationService>().RegisterOrderStateChanged(orderCarrier.ID);
}, null);
Build
Build the solution.