FluentEmail
FluentEmail copied to clipboard
Inline images in SendGridSender
Hi!
I`m trying to send email containing images using SendGridSender. But the images are not displayed in gmail and some other web cleints.
The raw SendGridClient supports the Disposition property (https://github.com/sendgrid/sendgrid-csharp/blob/main/src/SendGrid/Helpers/Mail/Model/Attachment.cs#L34-L38), which works fine. Unfortunately this property is not used in SendGridSender. And the IsInline property is not used at all.
Maybe this method should use the property like this? https://github.com/lukencode/FluentEmail/blob/master/src/Senders/FluentEmail.SendGrid/SendGridSender.cs#L141-L146
private async Task<SendGridAttachment> ConvertAttachment(Core.Models.Attachment attachment) => new SendGridAttachment
{
Content = await GetAttachmentBase64String(attachment.Data),
Filename = attachment.Filename,
Type = attachment.ContentType,
Disposition = attachment.IsInline ? "inline" : "attachment",
};
@lukencode I am willing to fix this issue with PR, but I wonder if you will approve it? One more thing missing here is ContentId