Another Marketing Automation gotcha
Tags: analytics, sitecore
Published: 2019-09-06 14:36:51

---
title: Another Marketing Automation gotcha
published: true
tags: Analytics,Sitecore
canonical_url: https://blog.jermdavis.dev/posts/2019/another-marketing-automation-gotcha
---

Following on from [my recent post about how I was able to mess up my life by getting Marketing Automation connection strings wrong](https://dev.to/jermdavis/shooting-myself-in-the-foot-with-marketing-automation-31o3-temp-slug-3025341), I hit another interesting issue with MA – this time around content languages…

## The issue

Looking at a newly deployed instance of Sitecore, my editor account couldn’t see any Campaign Templates in the Marketing Automation dashboard:

[![](https://jermdavis.files.wordpress.com/2019/06/empty-ma-dashboard.png?w=800&h=492)](https://jermdavis.files.wordpress.com/2019/06/empty-ma-dashboard.png)

That wasn’t right, as I could see the template items sitting in Content Editor:

[![](https://jermdavis.files.wordpress.com/2019/06/ma-templates.png?w=800&h=492)](https://jermdavis.files.wordpress.com/2019/06/ma-templates.png)

Doing a bit of digging, I noticed that that dasboard page was making a web service call that I could examine via browser dev tools:

[![](https://jermdavis.files.wordpress.com/2019/06/ma-fetchapi-2.png?w=800&h=492)](https://jermdavis.files.wordpress.com/2019/06/ma-fetchapi-2.png)

The request was passing in a querystring value: “`cultureName=fr-FR`” And the result of that call was a valid json response for no data:

```json
[]
```

But if I changed that url to use “en” as its language, the data changed:

```json
[
  {
    "id": "938ec74b-3ba4-4c93-9152-015655088998",
    "alias": "938ec74b-3ba4-4c93-9152-015655088998",
    "name": "Cart Abandonment",
    "children": null,
    "startDate": "0001-01-01T00:00:00Z",
    "endDate": "0001-01-01T00:00:00Z",
    "createdBy": "sitecore\\Admin",
    "createdDate": "2018-08-17T12:26:31Z",
    "cultureName": "en",
    "customValues": {},
    "description": "When a customer fails to complete an order, an automated marketing email message  is sent to the recipient. The intention is to re-engage the recipient and to encourage them to complete the order. Appropriate timings differ depending on the sales cycle of the product. In our example we show three email messages over three days. To discourage misuse of promotional codes in this campaign, brands may want to set a limit to the number of times a recipient can re-enter this campaign.",
    "isActive": false,
    "state": "Inactive",
    "lastModifiedBy": null,
    "lastModifiedDate": "2018-10-05T06:54:16Z",
    "version": 1,
    "classifications": {},
    "currentEnrollments": 0,
    "marketingThemeId": "85506484-7854-4b14-ab0c-dfc61ca65cc0",
    "maxEnrollmentsCount": null
  },

  -- snip --

  {
    "id": "ae5178d0-9484-41f3-8c9e-cb1b8f478e24",
    "alias": "Blank",
    "name": "Blank",
    "children": null,
    "startDate": "0001-01-01T00:00:00Z",
    "endDate": "0001-01-01T00:00:00Z",
    "createdBy": "sitecore\\Admin",
    "createdDate": "2018-04-03T04:07:59Z",
    "cultureName": "en",
    "customValues": {},
    "description": "",
    "isActive": false,
    "state": "Inactive",
    "lastModifiedBy": null,
    "lastModifiedDate": "2018-04-03T04:09:06Z",
    "version": 1,
    "classifications": {},
    "currentEnrollments": 0,
    "marketingThemeId": "00000000-0000-0000-0000-000000000000",
    "maxEnrollmentsCount": null
  }
]
```

So the issue is something to do with languages…

## Working around the issue

Thinking about this, I tried looking at the user’s settings:

[![](https://jermdavis.files.wordpress.com/2019/06/user-language.png?w=800&h=492)](https://jermdavis.files.wordpress.com/2019/06/user-language.png)

And I realised that these users who were having problems were set to have a specific default content language to match the client’s project requiremenents. If I change the user back to having the “default” or “en” then the Marketing Automation dashboard starts to work correctly again – which would fit with the behaviour seen by changing the url above.

A colleage suggested translating the Marketing Automation template items into the client’s required language might make a good workaround, so I tried that approach. Any items from the templates folder above that you translate start to appear in the templates view. So you can use the “create from template” option to try and make a new Marketing Automation flow. But unfortunately when the editor loads up you still get an error:

[![](https://jermdavis.files.wordpress.com/2019/06/brokentemplate.png?w=800&h=492)](https://jermdavis.files.wordpress.com/2019/06/brokentemplate.png)

In the logs, you get:

```
 728 20:37:07 ERROR [Sitecore Services]: HTTP GET
URL http://sc911.sc/sitecore/api/ma/automationcampaigntemplates/422e238c-65aa-4ec9-8f98-d563cdee6c72?cultureName=fr-FR&sc_site=shell

Exception System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Sitecore.Xdb.MarketingAutomation.Locators.Xmgmt.Resources.resources" was correctly embedded or linked into assembly "Sitecore.Xdb.MarketingAutomation.Locators.Xmgmt" at compile time, or that all the satellite assemblies required are loadable and fully signed.
   at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
   at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
   at Sitecore.Xdb.MarketingAutomation.Locators.Xmgmt.AutomationPlans.ItemActivityDescriptorLocator.ToActivityDescriptor(ActivityTypeItem activityTypeItem, CultureInfo culture)
   at Sitecore.Xdb.MarketingAutomation.Locators.Xmgmt.AutomationPlans.ItemActivityDescriptorLocator.GetDescriptor(Guid id, CultureInfo culture)
   at Sitecore.Marketing.Automation.Extensions.AutomationActivityDefinitionViewModelExtensions.ToViewModel(IAutomationActivityDefinition automationActivityDefinition, IActivityDescriptorLocator activityDescriptorLocator, CultureInfo culture, IActivityConverterFactory`1 activityConverterFactory, BaseLog logger)
   at Sitecore.Marketing.Automation.Extensions.AutomationPlanDefinitionViewModelExtensions.<>c__DisplayClass0_0.<ToViewModel>b__2(IAutomationActivityDefinition x)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Sitecore.Marketing.Automation.Extensions.AutomationPlanDefinitionViewModelExtensions.ToViewModel(IAutomationPlanDefinition automationPlanDefinition, IActivityDescriptorLocator activityDescriptorLocator, CultureInfo culture, IActivityConverterFactory`1 activityConverterFactory, BaseLog logger)
   at Sitecore.Marketing.Automation.Data.AutomationCampaignTemplateRepository.GetById(Guid id, String cultureName)
   at Sitecore.Marketing.Automation.Client.Controllers.AutomationCampaignTemplatesController.<GetById>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__1`1.MoveNext()
```

That reads like there’s a binary which does not have resource file data for the French language – and hence it’s not going to work.

However if I do switch the user back to having their default language be “en” then this does work… So it looks like users who want to modify automation flows need to make sure they have a default content language set “en” while they’re working…