Set up Papercut SMTP for Sitecore EXM in a Docker container.

Set up Papercut SMTP for Sitecore EXM in a Docker container.

For the sake of testing the EXM campaign, we'll configure PaperCut SMTP using a Docker container. Since no emails are transmitted to actual clients, PaperCut is an efficient SMTP server that can be used in testing or development environments.

We need Docker installed on our computer to configure PaperCut SMTP. Because there are so many online guides for setting up Docker, we won't discuss it here. If Docker hasn't already been installed, please do so by following the instructions on the Docker website.

Docker is not required to install PaperCut SMTP. It is directly installable on our personal PC. However, we'll use Docker in this tutorial. If you're unfamiliar with Docker, you should grasp its core. Using Docker, you'll develop substantially more quickly and easily as a result. On its website, there is a plenty of documentation.        

Install PaperCut SMTP

Let's get to work and install PaperCut using Docker locally. Start PowerShell with administrator access and perform the following command to install PaperCut; this will take a few minutes.

docker run --name=papercut -p 25:25 -p 37408:37408 jijiechen/papercut:latest

The aforementioned command will create?and start?a Docker container for PaperCut. To verify that?Papercut is properly installed, open https://localhost:37408/ URL in the?browser.?It should?show the?inbox to?view the test emails (view the below image).

No alt text provided for this image

Configure custom SMTP for EXM

To send emails from Sitecore, the SMTP server setup is necessary. For the sake of this guide, we set up PaperCut SMTP because we believe it to be incredibly easy to configure locally and the best option for doing testing without sending emails to real user accounts. Please adhere to the guidelines below.

Steps:

  • Open to <wwwroot> \App_Config\Sitecore\EmailExperience\Sitecore.EDS.Providers.CustomSMTP.config file and for scaled environment open it from CM or DDS server.
  • Update the SMTP settings as below.

No alt text provided for this image
We will use port 25 because PaperCut SMTP is listening on this port. If we carefully see the bold highlighted part of the command (used to install PaperCut in Docker) it is showing port on which its listening. In case any other port will be used while isntalling Papercut then set the same port in <smtpSettings><port>[25]</port>        

  • Let's then verify that the new SMTP settings we made are correct. After accessing the content editor, choose the Message Root item under Contents. In my case, it is /Sitecore/content/Email; then, choose Test Connection from the main menu. A window with a green check icon will show up if SMTP is configured properly.

No alt text provided for this image

Sample Emails List

Before we can see the EXM in action, we must build up a sample recipient email list. The email list can be conveniently uploaded using the list manager. I'm going to upload a CSV file with the first name, last name, and email addresses here. The file should be formatted as follows:

No alt text provided for this image
The best part is that all emails will be sent to the PaperCut inbox (https://localhost:37408/) where we can verify the email body/links etc        

Next, go to the Sitecore launch pad > marketing application > list manager >

No alt text provided for this image

Select Create > Create list from file >

No alt text provided for this image

It will display the Import Contact Wizard. Upload the CSV file that you made in the previous step.

Browse the File:

No alt text provided for this image

Click the Upload file button after changing the list's name (optional).

No alt text provided for this image

?Map the file column to the Sitecore column field:

No alt text provided for this image

When you press the Next button, Sitecore will import and build the contacts from the file. These imported contacts will be used to send emails via EXM.

We have already taken care of all the necessities. It's time to have some fun with the Sitecore EXM module by launching our first email campaign using it.

Click on Email Experience Manager in the Launch Pad.

No alt text provided for this image

Create the email campaign >?Click create > Regular Email Campaign >

No alt text provided for this image

Choose a template from the list; I went with a simple HTML message and called it "exm first campaign" for demonstration purposes.

No alt text provided for this image

Configure the campaign's name, description, and other essential details under the general information section. In the sender area, you may customize the "from name" and email that will appear in the email box.

The sender information influences various click rates, so this information is crucial.        
No alt text provided for this image

Select your list of recipients now. We already built this list in the preceding phase; all we need to do is provide the reference, as seen below:

No alt text provided for this image

The Message tab is the next one, and since we've already chosen the very simple Custom HTML template, we can just create an example HTML message for testing purposes as shown below:

You can experiment with the HTML, choose another predefined template, or import a custom HTML template.        
No alt text provided for this image

We're all set and prepared, but remember that "prevention is better than cure"

Before rolling out to the consumer, we should always test our campaigns. Sitecore has this function called "Review," which implies actual Review, therefore send the test email first. You may send several test emails by using a comma as seen below:

No alt text provided for this image

Let me quickly check my mailbox to see if there are any new emails. Indeed, I received the email below in a matter of seconds:

Verify your email for previews and testing.

No alt text provided for this image

I'll briefly go through the test email now, and if you like the content and formatting and want to send it to every receipt, click the "next steps to delivery" tab: Activate the Send message button. Boom – job?completed.

No alt text provided for this image

The real email should look like this:

No alt text provided for this image

I hope you find this information beneficial.

With Sitecore EXM, good luck.

Sumit Tandon

2*Sitecore Certified (10.X, 9.X)

1 年

Akif Irfan https://localhost:37408/?URL in the?browser.?It should?show the?inbox to?view the test emails (view the below image). [Question]: where it's showing emails from?

回复

要查看或添加评论,请登录

Akif Irfan的更多文章

  • Caching - Dictionary Service in Sitecore-JSS

    Caching - Dictionary Service in Sitecore-JSS

    I outlined the below scenario in a previous post. In this article, we will focus on performance improvement.

  • Dictionary Service in Sitecore-JSS

    Dictionary Service in Sitecore-JSS

    A dictionary of static words that needs to be translated is frequently required for multilingual apps. Typically, these…

社区洞察

其他会员也浏览了