private static void BuildEmail(MailItem mailItem, IEmailConfiguration emailConfiguration,
                                       NominationList nominationList)
        {
            mailItem.To = string.Join(";", emailConfiguration.HrPeople.Select(p => p.EmailAddress));
            mailItem.CC = string.Join(";", emailConfiguration.EiaCoChair1.EmailAddress, emailConfiguration.EiaCoChair2.EmailAddress);

            var hasStarValues = nominationList.HasNominationsForAward(AwardType.StarValues);
            var hasRisingStar = nominationList.HasNominationsForAward(AwardType.RisingStar);
            var hasSuperStar  = nominationList.HasNominationsForAward(AwardType.SuperStar);
            var awardsName    = nominationList.AwardsPeriod.AwardsName;

            mailItem.Subject = $@"Need: {awardsName} nominee eligibility check";

            var content = CreateContentNode();

            AppendIntroduction(content, emailConfiguration.HrPeople, awardsName);
            AppendNomineeCriteria(content, nominationList, hasStarValues, hasRisingStar, hasSuperStar);
            AppendThanks(content);
            AppendNominees(content, nominationList, hasStarValues, hasRisingStar, hasSuperStar);
            WriteMailItemBody(mailItem, content);
        }
        private static void BuildEmail(ComObjectManager com, MailItem mailItem, IEmailConfiguration emailConfiguration,
                                       IMailMergeFactory mailMergeFactory, NominationList nominationList, string votingSurveyWebLink)
        {
            var awardsName    = nominationList.AwardsPeriod.AwardsName;
            var hasStarValues = nominationList.HasNominationsForAward(AwardType.StarValues);
            var hasRisingStar = nominationList.HasNominationsForAward(AwardType.RisingStar);
            var hasSuperStar  = nominationList.HasNominationsForAward(AwardType.SuperStar);

            mailItem.To      = string.Join(";", emailConfiguration.EiaCoChair1.EmailAddress, emailConfiguration.EiaCoChair2.EmailAddress);
            mailItem.Subject = $@"EIA: {awardsName} voting survey review request";

            var content = CreateContentNode();

            AppendRequest(content, emailConfiguration.EiaCoChair1, emailConfiguration.EiaCoChair2, awardsName,
                          hasStarValues, hasRisingStar);

            AddVotingGuideAttachments(com, mailItem, content, mailMergeFactory, nominationList, hasStarValues,
                                      hasRisingStar, hasSuperStar);

            AppendVotingSurveyWebLink(votingSurveyWebLink, content);
            AppendThanks(content);
            WriteMailItemBody(mailItem, content);
        }
Пример #3
0
        private static void BuildEmail(ComObjectManager com, MailItem mailItem, IEmailConfiguration emailConfiguration,
                                       IExcelFileFactory excelFileFactory, NominationList nominationList)
        {
            var awardsName = nominationList.AwardsPeriod.AwardsName;

            mailItem.To      = string.Join(";", emailConfiguration.EiaCoChair1.EmailAddress, emailConfiguration.EiaCoChair2.EmailAddress);
            mailItem.Subject = $@"EIA: {awardsName} voting key";

            var hasStarValues = nominationList.HasNominationsForAward(AwardType.StarValues);
            var hasRisingStar = nominationList.HasNominationsForAward(AwardType.RisingStar);
            var hasSuperStar  = nominationList.HasNominationsForAward(AwardType.SuperStar);

            var content = HtmlNode.CreateNode(@"<div class=WordSection1>");

            AppendRequest(hasRisingStar, hasStarValues, content, emailConfiguration.EiaCoChair1,
                          emailConfiguration.EiaCoChair2, awardsName);

            AddVotingKeyAttachments(com, mailItem, content, excelFileFactory, nominationList, hasStarValues,
                                    hasRisingStar, hasSuperStar);

            AppendThanks(content);
            WriteMailItemBody(mailItem, content);
        }
Пример #4
0
        private static void BuildEmail(ComObjectManager com, MailItem mailItem,
                                       IMailMergeFactory mailMergeFactory, NominationList nominationList, string votingSurveyWebLink,
                                       DateTime votingDeadline)
        {
            var awardsName    = nominationList.AwardsPeriod.AwardsName;
            var hasStarValues = nominationList.HasNominationsForAward(AwardType.StarValues);
            var hasRisingStar = nominationList.HasNominationsForAward(AwardType.RisingStar);
            var hasSuperStar  = nominationList.HasNominationsForAward(AwardType.SuperStar);

            mailItem.To      = @"#[email protected]";
            mailItem.Subject = $@"*** Voting Open for the {awardsName} ***";

            var content = CreateContentNode();

            AppendRequest(content, awardsName, votingDeadline);

            AddVotingGuideAttachmentsAndInstructions(com, mailItem, content, mailMergeFactory, nominationList,
                                                     hasStarValues,
                                                     hasRisingStar, hasSuperStar);

            AppendVotingSurveyWebLink(votingSurveyWebLink, content);
            AppendThanks(content);
            WriteMailItemBody(mailItem, content);
        }
Пример #5
0
        private void SaveNomineeListExcelFile(WorkingDirectoryPath workingDirectoryPath, NominationList nominationList,
                                              AwardType awardType)
        {
            if (!nominationList.HasNominationsForAward(awardType))
            {
                return;
            }

            var fileName = awardType.GetNomineesForMemoFileName(nominationList.AwardsPeriod);
            var filePath = workingDirectoryPath.GetFilePathForFileInDirectory(fileName, false, false);

            using (var excelFile = _excelFileFactory.GetNomineeListExcelFile(awardType, nominationList))
            {
                excelFile.Save(filePath);
            }
        }