Skip to content

Commit

Permalink
Fixes 400 error empty content from sendgrid (#1867)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Coleman <benc.uk@gmail.com>
  • Loading branch information
benc-uk committed Jul 11, 2022
1 parent 32f986b commit 7eb619d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bindings/twilio/sendgrid/sendgrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ func (sg *SendGrid) Invoke(ctx context.Context, req *bindings.InvokeRequest) (*b
}

// Email body is held in req.Data, after we tidy it up a bit
emailBody, _ := strconv.Unquote(string(req.Data))
emailBody, err := strconv.Unquote(string(req.Data))
if err != nil {
// Unquote will error if the string is not quoted (not exactly graceful!), so fallback using the string as is
emailBody = string(req.Data)
}

// Construct email message
email := mail.NewV3Mail()
Expand Down

0 comments on commit 7eb619d

Please sign in to comment.