Skip to content

Commit

Permalink
fix: remove null fields from request
Browse files Browse the repository at this point in the history
  • Loading branch information
darylhjd committed Feb 22, 2024
1 parent a685f74 commit a13b3e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ vendor/

# Go workspace file
go.work

# IDE Settings
*.idea
*.vscode
6 changes: 3 additions & 3 deletions mail.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions send.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a13b3e8

Please sign in to comment.