Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending an attachment with a Content-Type including ; (e.g. with character coding specified) causes no "err" and no email... #450

Open
adamjack opened this issue Jan 7, 2022 · 1 comment
Labels
status: help wanted requesting help from the community type: bug bug in the library

Comments

@adamjack
Copy link

adamjack commented Jan 7, 2022

Issue Summary

Using the documented example code to send an attachment I (unintentionally) put a semi-colon in the type, and send failed semi-silently. I assume you'd like to return an error whenever the API calls fails, but error was nil.

Steps to Reproduce

  1. Use this example code: https://github.com/sendgrid/sendgrid-go/blob/main/use-cases/attachments-with-mailer-helper.md
  2. Do a SetType of "text/plain; charset=utf-8"
  3. No err is returned (so I thought it sent) but no email is sent. Looking inside the response I did see this, so fixed my problem:

400,{"errors":[{"message":"The attachment type cannot contain ';', or CRLF characters.","field":"attachments.0.type","help":"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.attachments.type"}

... I assume the preference is to set an "error" return whenever an email is not sent, so FYI on this.

Technical details:

  • sendgrid-go version: v3.10.0+incompatible
  • go version: go version go1.17 darwin/amd64
@JenniferMah JenniferMah added status: help wanted requesting help from the community type: bug bug in the library labels Jan 18, 2022
@JenniferMah
Copy link
Contributor

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

2 participants