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

Detect if an attachment is Base64 encoded, if not, automatically encode it #611

Closed
thinkingserious opened this issue May 19, 2018 · 2 comments · Fixed by #618
Closed

Detect if an attachment is Base64 encoded, if not, automatically encode it #611

thinkingserious opened this issue May 19, 2018 · 2 comments · Fixed by #618
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: twilio enhancement feature request on Twilio's roadmap

Comments

@thinkingserious
Copy link
Contributor

Issue Summary

This should be done in the [setContent](https://github.com/sendgrid/sendgrid-php/blob/master/lib/mail/Attachment.php#L78) method of the Attachment object.

See here for an example.

@thinkingserious thinkingserious added status: help wanted requesting help from the community difficulty: easy fix is easy in difficulty up-for-grabs type: twilio enhancement feature request on Twilio's roadmap labels May 19, 2018
@martijnmelchers
Copy link
Contributor

@thinkingserious

I could make this, but how would we detect if an attachment is base64 encoded?

@thinkingserious
Copy link
Contributor Author

@martijnmelchers,

Thanks for offering to take this on!

I don’t know the best way to do this yet and I’m open to suggestions.

A quick search on the web reveals a bunch of solutions, but not foolproof.

In the end we should be sure to return an exception if the SendGrid API rejects the encoding.

With Best Regards,

Elmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: twilio enhancement feature request on Twilio's roadmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants