25 Days of Sitecore EXM!
Configuring the Mail Distribution
Day 4’s post is going to get a little more technical and is geared towards developers. Out of the Box, Sitecore enables EXM by default and sets up the Mail Distribution provider as the CustomSMTP provider. However, the provider settings must be setup in order to send email. This post will dive into how to set those settings.
Enabling EXM (Or Disabling)
As mentioned, by default, Sitecore enables EXM. If you’d like to disable EXM, you can do so by editing the web.config file that comes shipped with Sitecore or adding in an XDT Transformation file with your deployment process. Specifically the setting in the <appSettings> of the web.config is the exmEnabled:define.
<add key="exmEnabled:define" value="yes" />
A value of yes (default setting) enables EXM.
A value of anything else like “no”, “false”, “your mom”, “SiteCore”, or “SIF-Default” will disable Sitecore’s EXM. This is because Sitecore has used this value as Sitecore Configuration require rules in all of the EXM configs and is explicitly looking for “yes”, including the config that has the EXM Global Settings EXM.Enabled which also dictates whether EXM is enabled or not.
Don’t Be Fooled!The right way to disable EXM is via the Web.config file. The Global Sitecore Setting of EXM.Enabled is a legacy setting that is utilized. When the Web.config setting is not “yes”, then proper configuration files are disabled in the system. Setting EXM.Enabled to False does not disable the configuration files, which in turn does not disable EXM completely and will leave the Sitecore instance in a state of confusion.
Defining the Delivery Provider
There are two Delivery Providers that are provided out of the box: CustomSMTP and EmailCloud. This provider is set in the web.config file in the eds:define app setting. Similar to how the exmEnabled:define variable is set, you can also use XDT Transforms to augment this value during your deployment processes. The default value out of the box is CustomSMTP.
<add key="eds:define" value="CustomSMTP" />
To Enable Sitecore Email Cloud Delivery Service, set this value to EmailCloud. There is no other configuration changes that need to made to make use of Sitecore’s Email Cloud delivery service.
<add key="eds:define" value="EmailCloud" />
Configuring Custom SMTP Settings
When using the CustomSMTP provider, the SMTP settings need to be patched in. It is Best Practice not to modify stock configuration files, and instead use a patch config to edit the settings. The following code block is an example of a patch config that a developer can use in their deployment processes. Simply change out the variables in the config.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:eds="http://www.sitecore.net/xmlconfig/eds/"> <sitecore role:require="Standalone or ContentManagement or DedicatedDispatch" eds:require="CustomSmtp"> <exm> <eds> <smtpSettings patch:instead="*[@type='Sitecore.EDS.Core.Net.Smtp.SmtpSettings, Sitecore.EDS.Core']" type="Sitecore.EDS.Core.Net.Smtp.SmtpSettings, Sitecore.EDS.Core" singleInstance="true"> <server>SMTPSERVER</server> <port>SMTPPORT</port> <userName>USERNAME</userName> <password>PASSWORD</password> <authenticationMethod>CramMd5</authenticationMethod> <startTls>true</startTls> <proxySettings ref="exm/eds/proxySettings" /> </smtpSettings> </eds> </exm> </sitecore> </configuration>
For a complete list and description of CustomSMTP settings that you can specify in the patch config, you can reference Sitecore’s CustomSMTP Setting documentation page.
Once the CustomSMTP configuration patch file is setup and deployed to the Content Management or Dedicated Dispatch servers, Email Experience Manager should be correctly configured to begin sending emails.
Testing Your MTA Connection
On any Sitecore EXM Manager Root item, there is a Test Connection button in the Content Editor.
Clicking on this button will test your connection to your Mail Transit Authority (MTA). This will work for both EmailCloud or CustomSMTP delivery providers. A successful connection to the MTA service will display the following.
This conclude’s Day 4 of 25 Days of Sitecore EXM! If you see the green check in your Test Connection, you are ready to start sending emails. Tomorrow (Day 5) we will begin a 4-Part miniseries on creating and sending your first email message from Email Experience Manager in Sitecore!
Don’t forget to register for my Sitecore EXM webinar on December 13 EXM Live! An Email Automation Experience!
Register for EXM Live! Webinar