The Creative Mail app is a more refined version of the BeeFree app and uses new Salesforce features such as Lightning Email Templates. Because of this during migration you will need to create new Email Templates from the existing ones but no need to worry, in order to make your lives simpler, we have created a nifty little script that will do most of the handling for you.
Just follow the simple steps mentioned below -
- First, ensure that you have installed and set up Creative Mail
- Click on the gear icon on the top right and open the Developer Console
- From the menu click on Debug and select Open Execute Anonymous Window
- Copy and paste the snippet below to copy over your BeeFree Templates onto your new Creative Mail Templates
List<creativemail__Creative_Mail_Template__c> cmTemplateList = new List<creativemail__Creative_Mail_Template__c>(); List<BeeFree__BeeFree_Template__c> bfTemplateList = [ SELECT Id, Name, BeeFree__Email_Template_Id__c, BeeFree__JSON_Template__c, BeeFree__Recipient_Type__c, BeeFree__Related_To_Type__c FROM BeeFree__BeeFree_Template__c ]; Set<Id> emailTempIds = new Set<Id>(); for (BeeFree__BeeFree_Template__c bfTemplate : bfTemplateList) { emailTempIds.add(bfTemplate.BeeFree__Email_Template_Id__c); } Map<Id, EmailTemplate> emailTemplateMap = new Map<Id, EmailTemplate>( [SELECT Id, Subject FROM EmailTemplate WHERE Id IN :emailTempIds] ); for (BeeFree__BeeFree_Template__c bfTemplate : bfTemplateList) { creativemail__Creative_Mail_Template__c cmTemplate = new creativemail__Creative_Mail_Template__c(); cmTemplate.Name = bfTemplate.Name.replace('_', ' ') + ' clone'; cmTemplate.creativemail__JSON_File_1__c = bfTemplate.BeeFree__JSON_Template__c; cmTemplate.creativemail__Recipient__c = bfTemplate.BeeFree__Recipient_Type__c; cmTemplate.creativemail__Related_To__c = bfTemplate.BeeFree__Related_To_Type__c == '--none--' ? null : bfTemplate.BeeFree__Related_To_Type__c; cmTemplate.creativemail__Subject__c = emailTemplateMap.get( bfTemplate.BeeFree__Email_Template_Id__c ) ?.Subject; cmTemplateList.add(cmTemplate); } insert cmTemplateList;
- Click on execute
- The last step you will need to perform is to go into each Creative Mail Template, click on the Edit Template in Builder button and then hit save in order to generate the new Lightning Email Template.
Please make sure to update the merge fields since the merge field syntax is different for Lightning Email Templates.
NOTE:
Please ensure to update the Creative Mail Template names as they need to be unique and will be appended with 'clone' during the migration process.
Feel free to reach out to us if you have any issues at contact@codejinn.in