0

Sitecore sales engineers said this scenario is not possible, and it's the one sticking point for a client that wants to use EXM, so I thought I would check with the community.

In an email definition, we would build a component that would check for which user is getting the email, then get back the content that matches criteria they have specified in their user profile that was updated in a certain timeframe, and we would send that email tailored to the user. This, we're told, can be done.

However, in the event the component returns no matching content, we do NOT want the user to get the email. If you were coding this fully by hand, it'd be like using a foreach loop, hitting an if (!content.Any()) statement, and then saying continue to move onto the next user.

Is there some pipeline call or other trigger that can be used to stop that email from firing? A good example, early in the morning there may have been no content updates, we don't want 10,000 users getting an email that says "here's your 8am update, nothing new!" Besides being worthless from an information standpoint, it's wasteful for any potential email counts towards pricing tiers.

  • Would the content (or lack thereof) be the same for all 10,000 users? – Pete Navarra Dec 15 '17 at 17:58
  • In most case, no. – Ken McAndrew Dec 15 '17 at 19:56
  • 1
    Also I'm curious why someone down-voted the question... – Ken McAndrew Dec 15 '17 at 19:58
1

I would take a look at the <SendEmail> pipeline.

  <SendEmail>
    <processor type="Sitecore.EmailCampaign.Cm.Pipelines.SendEmail.FillEmail, Sitecore.EmailCampaign.Cm">
      <param desc="cipher" ref="exmAuthenticatedCipher" />
    </processor>
    <processor type="Sitecore.EmailCampaign.Cm.Pipelines.SendEmail.SendEmail, Sitecore.EmailCampaign.Cm" />
    <processor type="Sitecore.EmailCampaign.Cm.Pipelines.SendEmail.CreateTask, Sitecore.EmailCampaign.Cm">
        <param ref="exm/sentMessagesTaskPool"/>
        <param desc="logger" ref="exmLogger" />
    </processor>
    <processor type="Sitecore.EmailCampaign.Cm.Pipelines.SendEmail.Sleep, Sitecore.EmailCampaign.Cm">
          <!-- Number of milliseconds to put the thread to sleep for after an email has been sent. -->
          <param desc="sleep">50</param>
      </processor>
  </SendEmail>

Theoretically, you can place a processor AFTER FillEmail but before SendEmail to validate the Message Body. You could configure the component to output a very specific string in the output of the HTML that you can then scan for, and abort the pipeline. (I'm not sure if the abort of the individual pipeline would bubble up to the whole dispatch).

Disclaimer: Adding steps to this pipeline can dramatically reduce dispatch send times. Use with caution.

  • That's at least an avenue to explore, with the caveats noted of course. We'd need to experiment with it for sure! Thanks for the suggestion, Pete. – Ken McAndrew Dec 15 '17 at 19:57

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.