1

We have a requirement to customize the look of the confirmation emails sent by EXM when a user subscribes to a contact list, specifically we need a custom header and footer. I have tried to replace the Layout used on the "Subscription Confirmation" item (of template HTML Message) under the manager root, but the confirmation email happily disregards this change.

Looking through the source with dotPeek I discovered that when the confirmation message is fetched, it does so with the method GetStandardMessage, which eventually calls the GetMessageBody method in the Sitecore.Modules.EmailCampaign.Messages.HtmlMail class. This method builds the wrapper of the entire HTML email in one hard-coded line (including a 4px margin on the body element), and injects the value of the "Body" RTE field into the email. For obvious reasons I don't want to include my custom header and footer in the rich text field.

The documentation has a section on building a custom message template, but does not mention how to override the layout of the built-in notification emails. Since the whole feature of "double opt-in" process seems brand new, I have difficulties finding examples of how to perform the customization I'm looking for.

Any suggestions?

Clarification: This is with the built-in version of EXM that comes with Sitecore 9.0.1

3
  • Can you please specify the version of Sitecore and/or EXM version you're working with?
    – Pete Navarra
    Apr 11, 2018 at 15:48
  • 1
    9.0.1. Edited the original message.
    – JohnL
    Apr 11, 2018 at 15:51
  • Hi, did you manage to build this functionality, we have similar need and when we update the presentation details, it shows right layout in experience editor but preview still shows old email message and send the default sitecore text
    – Meenakshi
    Nov 2, 2020 at 0:59

1 Answer 1

4

Instead of customizing the existing template, you're better off creating your own template and create a message based on that.

Documentation is being written to explain how this is done, but here are the steps:

  1. (Optional) Create a custom message template. See Building a custom message template
  2. Create your custom confirmation message and overwrite the default settings:

In EXM, there are a range of service message that you can use to, for example, send a subscription confirmation.

You can use the default service messages or you can customize or replace them.

All the service messages are stored in the manager root:

manager root service messages

In the

App_Config\Sitecore\EmailExperience\Sitecore.EmailExperience.ContentManagement.config

configuration file, you can:

  • Replace a service message with your own. The path to the message must be relative to the manager root.
  • Remove a service message, if you do not want to send a specific service message. If you, for example, never use the unsubscribe notification, you can remove the value of that setting in the configuration file.

Note: Some of the service messages use custom tokens that you may wish to add to your own custom service messages.

Subscription confirmation

Custom token:

  • $link$ - will be replaced by the confirmation link

Setting name: StandardMessages.SubscriptionConfirmation

Default value: "Service Messages/Self-Service Subscription/Subscription Confirmation"

Subscription notification

Once a contact has subscribed (and confirmed their subscription if that option is selected) using the EXM API, a subscription notification is sent Setting name

No custom tokens.

Setting name: StandardMessages.SubscriptionNotification

Default value: "Service Messages/Self-Service Subscription/Subscription Notification"

Unsubscribe notification

Once a contact has unsubscribed from a list, an unsubscribe notification is sent to the contact. This is only done for contact lists included for the email campaign i.e. a notification is not sent when adding the contact to the global opt-out list.

Custom token:

  • $ListName$ - Will be replaced by the name of the list the contact was subscribed to

Setting name: StandardMessages.UnsubscribeNotification

Default value: "Service Messages/Self-Service Subscription/Unsubscribe Notification"

Dispatch completed

During the email campaign creating process, on the Delivery tab, you have the option to notify a set of email addresses when dispatch has completed. Once dispatch has completed, this service message will be sent to the specified email addresses.

Custom tokens:

  • $message$ - Will be replaced by the name of the email campaign
  • $status$ - The status of the email campaign e.g. completed
  • $sent$ - The number of recipients
  • $failed$ - The number of failed recipients

Setting name: StandardMessages.DispatchCompleted

Default value: "Service Messages/Status Messages/Dispatch Completed"

Triggered notification

Once an automated email campaign is activated or deactivated, a notification will be sent to any email addresses specified in the notification field on the Delivery tab.

Custom tokens:

  • $message$ - Will be replaced by the name of the email campaign
  • $status$ - The status of the email campaign e.g. completed

Setting name: StandardMessages.TriggeredNotification

Default value: "Service Messages/Status Messages/Automated Notification"

1
  • I am using _clientApiService.UpdateListSubscription(subscribeOptions) in EXM client API and it is not sending any email to contact by default
    – User7864
    Mar 26, 2021 at 3:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.