diff --git a/.gitignore b/.gitignore index b8c2a57..6577190 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,7 @@ vendor/ # Go workspace file go.work + +# IDE Settings +*.idea +*.vscode diff --git a/mail.go b/mail.go index 9076b73..661172f 100644 --- a/mail.go +++ b/mail.go @@ -1,9 +1,9 @@ package azmail type Mail struct { - Recipients MailRecipients `json:"recipients"` - Content MailContent `json:"content"` - Attachments []MailAttachment `json:"attachments"` + Recipients MailRecipients + Content MailContent + Attachments []MailAttachment } type MailRecipients struct { diff --git a/send.go b/send.go index 022be87..0da870d 100644 --- a/send.go +++ b/send.go @@ -8,17 +8,17 @@ import ( ) type mailMessage struct { - Attachments []MailAttachment `json:"attachments"` + Attachments []MailAttachment `json:"attachments,omitempty"` Content MailContent `json:"content"` Recipients MailRecipients `json:"recipients"` - ReplyTo []MailAddress `json:"replyTo"` + ReplyTo []MailAddress `json:"replyTo,omitempty"` SenderAddr string `json:"senderAddress"` UserEngagementTrackingDisabled bool `json:"userEngagementTrackingDisabled"` } func (c *Client) newMailMessage(mail Mail) mailMessage { return mailMessage{ - nil, + mail.Attachments, mail.Content, mail.Recipients, nil,