2

有谁知道 Sitecore ECM 中是否有一个设置会禁用发送到重复的电子邮件地址(Sitecore 6.5 rev 706 ECM 1.3.2 rev 120424)。我没有在开发文档中找到任何提及 - 但它似乎是一个常见的要求。还是我需要覆盖发送管道并将其实现为自定义功能?

干杯

4

1 回答 1

2

您可以将自己的步骤添加到 DispatchNewsletter 管道,而不是覆盖发送管道。

在该管道中,您可以访问所有收件人,并且可以过滤它们。

这是一些应该可以工作的代码,但我还没有测试过

public void Process(DispatchNewsletterArgs args)
{
    // Lets not filter emails from engagement automation
    TargetAudienceBase targetAudience = args.Message.TargetAudience;

    if (targetAudience.Name != "Engagement Automation")
    {
        // Cleas who gets the email
        args.Message.SubscribersNames.Clear();


        // holds list of email address, and contancts.
        var emailSendingTo = new Dictionary<string, Contact>();


        // Filter all recipients from the targetAudience
        foreach (Contact contact in targetAudience.OptInList.Contacts.Except(targetAudience.OptOutList.Contacts))
        {
            if (!emailSendingTo.ContainsKey(contact.InnerUser.Profile.Email))
            {
                emailSendingTo.Add(contact.InnerUser.Profile.Email, contact);
            }
        }

        // Add all the names to the subscriber list (domain/username)
        foreach (KeyValuePair<string, Contact> keyValuePair in emailSendingTo)
        {
            args.Message.SubscribersNames.Add(keyValuePair.Value.Name);
        }

    }
}

在 DeployAnalytics 之前插入该步骤,使分析按应有的方式工作

于 2012-11-26T10:05:57.530 回答