Repository navigation
Conversation
SendGrid is a Twilio product served from its own host, api.sendgrid.com. The Twilio emulator already serves several Twilio product hosts under one server, and Mail Send's /v3/mail/send path does not collide with any Twilio route, so the emulator now serves it at the root. Requests authenticate with a Bearer API key. A missing or malformed header returns 401 "authorization required", an unknown key returns 401 "The provided authorization grant is invalid, expired, or revoked", and a key restricted by scopes must include mail.send or gets 403 "access forbidden". The default seed adds one key; twilio.sendgrid.api_keys adds more with optional names and scopes. An accepted request returns 202 with an empty body and an X-Message-Id header, and the original body is stored with the sender and every to, cc, and bcc recipient. Validation follows the documented Mail Send errors and reports every problem at once in SendGrid's errors array of message, field, and help objects: sender, personalizations and the 1,000 personalization and recipient limits, duplicate recipients, subjects, content order with text/plain before text/html, attachments, headers and reserved header names, categories, custom_args, substitutions, reply_to and reply_to_list, send_at within 72 hours, ASM groups, and mail and tracking setting types. Requests over 30 MB return 413. Sandbox mode validates and returns an empty 200 without storing the message. A template_id request may omit content and subject. Templates are not rendered; the template ID and dynamic_template_data are stored as sent. The inspector gains a SendGrid tab with captured mail and masked keys. @sendgrid/client and @sendgrid/mail are dev dependencies used only to test the official Node packages against the route. Co-authored-by: Kamal Fariz Mahyuddin <269+kamal@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Comment on lines
+567
to
+570
| for (const [path, type, message] of checks) { | ||
| const value = getPath(settings, path); | ||
| if (value !== undefined && typeof value !== type) add(message, `${name}.${path}`); | ||
| } |
Contributor
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POST /v3/mail/sendfrom the Twilio emulator with Bearer API keys, an empty 202 withX-Message-Id, sandbox mode, and SendGrid'serrorsarray for every documented validation failure.@sendgrid/mailand@sendgrid/clientpackages as dev dependencies. Closes feat(twilio): emulate SendGrid Mail Send #259.