29 lines
892 B
C#
29 lines
892 B
C#
using Contracts.BindingModels;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net.Mail;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using DatabaseImplement.Models;
|
|
|
|
namespace BusinessLogic.Tools.Mail.MailTemplates
|
|
{
|
|
public class MailBillSender : Mail
|
|
{
|
|
public MailBillSender(string recipientEmail, byte[] invoicePdfBytes)
|
|
{
|
|
To = [recipientEmail];
|
|
Title = "Ваш чек";
|
|
Body = "";
|
|
|
|
// Создаем MemoryStream из байтового массива инвойса
|
|
var memoryStream = new MemoryStream(invoicePdfBytes);
|
|
// Создаем Attachment, используя MemoryStream
|
|
var attachment = new Attachment(memoryStream, "invoice.pdf", "application/pdf");
|
|
Attachments.Add(attachment);
|
|
}
|
|
}
|
|
}
|