Esempio n. 1
0
        public async Task <IEmail> CreateForUserReportRequestedAsync(User user, byte[] report)
        {
            var emailBodytemplate = await _templateFactory.CreateForUserReportRequestedAsync(user);

            var emailBodyTemplateRendered = await _templateService.RenderAsync <string>(emailBodytemplate);

            return(new Email
            {
                UseCustomSmtpServer = false,
                To = user.Email,
                Subject = "InventApp - Inventions Report",
                Body = emailBodyTemplateRendered,
                Attachments = new List <Attachment>
                {
                    new Attachment
                    {
                        FileContent = report,
                        FileName = $"inventions_{Guid.NewGuid()}.pdf"
                    }
                }
            });
        }