Skip to content

Inline images in SendGridSender #297

Description

@chakrygin

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

privateasyncTask<SendGridAttachment>ConvertAttachment(Core.Models.Attachmentattachment)=>newSendGridAttachment{Content=awaitGetAttachmentBase64String(attachment.Data),Filename=attachment.Filename,Type=attachment.ContentType,Disposition=attachment.IsInline?"inline":"attachment",};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions