Skip to content

Cannot sendMail with attachments #26

@ConradIrwin

Description

@ConradIrwin

Currently the way that SendMail is defined, it is not obvious how to send a message with attachments.

Message is defined with Attachments: []Attachment; but when you pass an Attachment object to the API, you must provide either a FileAttachment or an ItemAttachment. In my case I wanted to provide a FileAttachment, which requires setting the ContentBytes field, which is not present on the Attachment struct.

I realize this is somewhat of a problem with representing the graph data-types (which make use of subclassing) in Go (which doesn't); and wondered if you'd given this some thought already – it's definitely not clear what the right solution is. Maybe an AddFileAttachment(file *FileAttachment) method on SendMailRequestBuilder?

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