コード例 #1
0
 public async Task <Email> RenderSiteApprovedHibcEmailAsync(SiteApprovalEmailViewModel viewModel)
 {
     return(new Email
            (
                from: PrimeEmail,
                to: MohEmail,
                subject: "Site Registration Approved",
                body: await _razorConverterService.RenderTemplateToStringAsync(RazorTemplates.Emails.SiteApprovedHibcEmailTemplate, viewModel)
            ));
 }
コード例 #2
0
        public async Task SendSiteApprovedHIBCAsync(Site site)
        {
            var viewModel = new SiteApprovalEmailViewModel
            {
                DoingBusinessAs = site.DoingBusinessAs,
                Pec             = site.PEC
            };

            var email = await _emailRenderingService.RenderSiteApprovedHibcEmailAsync(viewModel);

            await Send(email);
        }
コード例 #3
0
        public async Task SendSiteApprovedSigningAuthorityAsync(Site site)
        {
            var viewModel = new SiteApprovalEmailViewModel
            {
                DoingBusinessAs = site.DoingBusinessAs,
                Pec             = site.PEC
            };

            var email = await _emailRenderingService.RenderSiteApprovedSigningAuthorityEmailAsync(site.Provisioner.Email, viewModel);

            await Send(email);
        }
コード例 #4
0
        public async Task SendSiteApprovedPharmaNetAdministratorAsync(Site site)
        {
            var viewModel = new SiteApprovalEmailViewModel
            {
                DoingBusinessAs = site.DoingBusinessAs,
                Pec             = site.PEC
            };

            var email = await _emailRenderingService.RenderSiteApprovedPharmaNetAdministratorEmailAsync(site.AdministratorPharmaNet.Email, viewModel);

            await Send(email);
        }
コード例 #5
0
        public async void TestRender_SiteApprovalEmails(RazorTemplate <SiteApprovalEmailViewModel> template)
        {
            var service = CreateService();
            var model   = new SiteApprovalEmailViewModel
            {
                DoingBusinessAs = "dba",
                Pec             = "pec"
            };

            var html = await service.RenderTemplateToStringAsync(template, model);

            Assert.NotNull(html);
            Assert.Contains(model.DoingBusinessAs, html);
            // Not all emails contain the PEC despite sharing a View Model.
        }
コード例 #6
0
 public async Task <Email> RenderSiteApprovedPharmaNetAdministratorEmailAsync(string recipientEmail, SiteApprovalEmailViewModel viewModel)
 {
     return(new Email
            (
                from: PrimeEmail,
                to: recipientEmail,
                subject: "Site Registration Approved",
                body: await _razorConverterService.RenderTemplateToStringAsync(RazorTemplates.Emails.SiteApprovedPharmaNetAdministratorEmailTemplate, viewModel)
            ));
 }