public Functions( IEmailService emailService, ISendgridEmailParser sendgridEmailParser) { _emailService = emailService; _sendgridEmailParser = sendgridEmailParser; }
public static EmailRequest Parse(Stream stream, ISendgridEmailParser sendgridEmailParser) { var ms = new MemoryStream(); stream.CopyTo(ms); ms.Position = 0; var email = sendgridEmailParser.Parse(ms); ms.Position = 0; var checksum = Logic.Checksum.Calculate(ms); ms.Position = 0; var request = new EmailRequest { Body = ms, Email = email, Checksum = checksum, Timestamp = email.Date }; return(request); }