【问题标题】:Sitecore ECM - Do not send to duplicate email addressesSitecore ECM - 不要发送到重复的电子邮件地址
【发布时间】:2012-11-25 20:45:52
【问题描述】:

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

干杯

【问题讨论】:

    标签: sitecore sitecore6 sitecore-ecm


    【解决方案1】:

    您可以将自己的步骤添加到 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 之前插入该步骤,使分析按应有的方式工作

    【讨论】:

    • 感谢邓斯顿正是我所需要的——非常感谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-16
    • 1970-01-01
    • 2017-01-08
    相关资源
    最近更新 更多