7

We have a site in production that uses ECM 2.1 (before EXM). The production environment consists of a CM server and 2 CDs.

There is some code running on the CD servers that creates and sends messages using AyncSendingManager. Much the same as this post from briancaos:

https://briancaos.wordpress.com/2016/03/19/sitecore-exm-send-an-email-from-code/

Could there potentially be any way to make sure that the message sends from a job on the CM box rather than the CD server or is this impossible?

  • what exm version is it? – josedbaez Oct 21 '16 at 11:31
  • sorry just saw the version. My answer doesn't apply at all :D – josedbaez Oct 21 '16 at 11:37
  • its 2.1 rev 140214 – Ian Graham Oct 21 '16 at 11:37
  • ok, no problems – Ian Graham Oct 21 '16 at 11:39
5

I believe it should be possible, by configuring your CM box to act as the "dedicated server" for your setup.

With reference to this guide - section 3.1.3.

E-Mail Campaign Manager for Sitecore CMS 6.5 - Administrator’s and Developer’s Guide

As far as I can tell; all you would need to do on your CD server, is remove the <scheduled> section from your Sitecore.EmailCampaign.config file. Then on your CM server, tell it that it is the master by adding the address of the CM to the <DedicatedServers> section of the same config file.

As best I know; this would make your CM box the point of origin for all ECM messages.

4

You could create the email and later scheduled it, instead of sending it. As you should have removed the sections that let ECM send scheduled emails from the CD (section 3.4.2 of this document), only the CM should handle it.

Please note that on ECM 2.1 having dedicated instances <DedicatedServers> does not mean that those instances will be the only one sending the emails, but that the role of that instance is dedicated to dispatching emails only (It will process only the sendemail pipeline).

MessageRepository _messageRepository = new MessageRepository();
Message message = _messageRepository.GetMessage(messageItem.ID.ToString());
message.ScheduledStartDateTime = DateTime.Now;
DispatchService ds = new DispatchService(messageRepository, new ABTestRunner(messageRepository), new ScheduledDispatch()))
ds.Schedule(message);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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