An Issue with Empty Subject Field in Sitecore EXM

I was working with Email Experience Manager 3.3.0 rev. 160527 (EXM) a few weeks ago and I’ve experienced an unusual issue during the implementation. The task was to integrate a new html for corporate emails. I’ve created a new layout and renderings, copied the EXM’s “Newsletter Message” branch template (/sitecore/templates/Branches/Email Campaign/Messages/Newsletter/Newsletter Message), set the newly created renderings to it and added a new insert option for the new email creation based on my branch template.

I was following the regular steps:

  1. create new email based on my branch;
  2. set the Included recipient lists (at least with the my email for testing);
  3. set the Excluded recipient lists;
  4. set the Subject;
  5. configure the email body;
  6. go to the delivery tab and click "Send message";

I should have received the message….. But have not! Instead, I received the notification: “The message status has been changed to 'Paused'”.

 exm field blank

Checking the EXM log to understand what happened I've found the error:

MessageTaskRunner worker thread 1 10:25:05 ERROR Message sending error: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Empty strings are not allowed.
Parameter name: message.Subject
at Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName)
at Sitecore.EDS.Core.Net.Smtp.MessageTransport`1..ctor(EmailMessage message)
at Sitecore.EDS.Providers.CustomSmtp.DispatchProvider.<SendEmailAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at
………………………………..………………………………..…………………………………
………………………………..………………………………..…………………………………
………………………………..………………………………..…………………………………

Looks like I've forgot to set the Subject field. I’ve opened the email and checked the subject. It was really empty. Filled in the subject field and tried to send the email over and over again. Result was the same… Every time.

Solution

Solution to the issue was really simple, but I had to spent a lot of time to resolve it.

The fact is that EXM checks if email has the “Set Page Title” rendering (/sitecore/layout/Renderings/Email Campaign/Set Page Title) at the presentation. And if it is not, EXM will skip subject and leave it blank. As a result, EXM throws the exception. After adding the rendering, the issue was solved.

item insert

The “Set Page Title” rendering has to be added between the <head></head> tags:

email header

IMPORTANT! Make sure that The “Set Page Title” rendering is added at the Shared Layout. If it is added to the Final Layout, it will not work.

Please let us know if you find it helpful or if you may suggest a better solution.