コード例 #1
0
 public ReturnService(
     IDataRepository dataRepository,
     EmailSendingService emailSendingService)
 {
     this.dataRepository      = dataRepository;
     this.emailSendingService = emailSendingService;
 }
コード例 #2
0
        public static void SendUserAddedEmailToExistingUsers(Organisation organisation, User addedUser, EmailSendingService emailSendingService)
        {
            IEnumerable <string> emailAddressesForOrganisation = organisation.UserOrganisations
                                                                 .Where(uo => !uo.User.HasBeenAnonymised)
                                                                 .Select(uo => uo.User.EmailAddress)
                                                                 .Where(ea => ea != addedUser.EmailAddress);

            foreach (string emailAddress in emailAddressesForOrganisation)
            {
                emailSendingService.SendUserAddedToOrganisationEmail(emailAddress, organisation.OrganisationName, addedUser.Fullname);
            }
        }
コード例 #3
0
        public static void SendSuccessfulSubmissionEmailToRegisteredUsers(Return postedReturn, string reportLink, string submittedOrUpdated, EmailSendingService emailSendingService)
        {
            IEnumerable <string> emailAddressesForOrganisation = postedReturn.Organisation.UserOrganisations
                                                                 .Select(uo => uo.User.EmailAddress);

            foreach (string emailAddress in emailAddressesForOrganisation)
            {
                emailSendingService.SendSuccessfulSubmissionEmail(
                    emailAddress,
                    postedReturn.Organisation.OrganisationName,
                    submittedOrUpdated,
                    postedReturn.GetReportingPeriod(),
                    reportLink);
            }
        }