Trap that Email

My work life in the past few weeks has been all Sitecore EXM – Email Experience Manager. Working my way through the excellent blog posts by Peter Navarra https://sitecorehacker.com/2018/11/26/25-days-of-sitecore-exm/, I managed to customize my client’s requirements into practical, functional and elegant templates for automation . So what exactly am I going on about here? Hold on…

Okay, I followed the blogs, built some cool templates and then FIREWALL! How am I going to test and prove my templates are as cool as I claim them to be? As with most clients, mine too has security restrictions accessing personal emails of the likes of yahoo,gmail etc. development environments. Now that’s a real problem. I did a little snooping and came across this cool app Mailtrap. https://mailtrap.io. I could actually see it flying across in a super hero costume :-)). (Okay , that must’ve been my imagination in overdrive after long sleepless nights. )

In their own words, Mailtrap is a safe email testing tool for staging and development. This helps in inspecting email samples without spamming the customers/client.

First step is to create an account in Mailtrap. There are several options/plans available. I just chose the freebie one.

Next, we need to configure Mailtrap in EXM. Configuration is very self explanatory. Refer to the section Sitecore.EDS.Providers.CustomSmtp.config from the document https://doc.sitecore.com/developers/exm/34/email-experience-manager/en/the-exm-configuration-settings.html

I created a config patch in my feature layer. Looks like this

<!-- Configure your Feature.EmailSMTP Sitecore config patches here, if any -->

<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 type="Sitecore.EDS.Core.Net.Smtp.SmtpSettings, Sitecore.EDS.Core" singleInstance="true">
	<server>smtp.mailtrap.io</server>
        <port>2525</port>
	<userName>4ca2f9f0c81012</userName>
	<password>884d145a3acd56</password>
	<authenticationMethod>PLAIN</authenticationMethod>
	<startTls>true</startTls>
	<proxySettings ref="exm/eds/proxySettings" />
</smtpSettings>
</eds>
</exm>
</sitecore>
</configuration>

Time to test the test. Open your Content Editor and Browse to the Email root. If you do not see one, (Really?), Visit Email Experience Manager and get back. You will have one created for you. Unless, you have custom email roots. (We do…) Select the Email root and click on the Test Connection button on the ribbon.

That’s all there is to it! I could test all my templates in a local environment.

Just a last word of caution, remember to disable the config before you go live 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s