EXM — Activate / Deactivate all email campaigns with one click
When working on a project that has a lot of EXM campaigns, a missing Sitecore feature is the ability to activate or deactivate all email campaigns. There are two reasons why I want to be able to do this:
- If I sync the email campaigns from one environment to another, the marketing definitions don’t get created and deployed, and statistics are not created in the EXM.Master database.
- For ease of editing something across multiple campaigns, it is slow to have to deactivate, then make the change, then reactivate.
Create a new Sitecore admin page
First create a Web Form (aspx) page called ExmMessageActivator in your Visual Studio solution under a sitecore/admin folder.
Then on the code behind add the following:
Note: You will need to tweak the EmailXpath value depending on your Email Message Root and Email Template ID.
Then just compile, deploy, and you can hit the sitecore/admin/ExmMessageActivator.aspx page and you should see as follows:
If you find this useful I could eventually clean it up and add a lot of features such as a select list of active / draft campaigns to selectively activate. Let me know!