ProtectedProviderReturns the name of this provider for use in error messages. Override in subclasses to provide a more descriptive name.
Convenience gate: true when this provider supports inbound push in ANY form
(subscription-managed or inbound-parse), false otherwise. Lets callers cleanly
short-circuit — if (provider.SupportsPush) { ... } — instead of probing individual
operations.
Derived from GetSubscriptionCapabilities so it stays in lockstep with actual
capability: providers that support push return capabilities and thereby report
SupportsPush === true for free; providers that don't return undefined and report
false. Subclasses normally do NOT override this — override
GetSubscriptionCapabilities instead.
Archives a message. Override in subclasses that support this operation.
Parameters for archiving the message
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Creates a draft message using the provider.
Optionalcredentials: SendGridCredentialsRegisters a hostname→URL Inbound Parse mapping with SendGrid so inbound email to
params.Identifier (the receiving hostname/subdomain, e.g. parse.example.com) is
POSTed to params.NotificationUrl.
The returned SubscriptionID is the hostname itself — it is the key SendGrid uses
for DeleteSubscription. ExpiresAt is always undefined (Inbound Parse
settings never expire).
Identifier (receiving hostname) and NotificationUrl (https endpoint)
Optionalcredentials: SendGridCredentialsOptional SendGrid credentials override for this request
Promise
Deletes a message. Override in subclasses that support this operation.
Parameters for deleting the message
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Deletes an Inbound Parse mapping by hostname (params.SubscriptionID). Idempotent:
a 404 (mapping already gone) is treated as success.
SubscriptionID is the hostname returned by CreateSubscription
Optionalcredentials: SendGridCredentialsOptional SendGrid credentials override for this request
Promise
Downloads an attachment from a message. Override in subclasses that support this operation.
Parameters for downloading the attachment
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Forwards a message to another client using the provider.
Optionalcredentials: SendGridCredentialsFetches messages from the provider.
Optionalcredentials: SendGridCredentialsGets a single message by ID. Override in subclasses that support this operation.
Parameters for retrieving the message
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Returns SendGrid's Inbound Parse subscription capabilities. Inbound Parse settings
never expire (no MaxLifetimeMinutes), watch only inbound-created messages, need no
endpoint validation handshake, are manageable via the REST API, and deliver the full
payload inline.
Returns the list of operations supported by the SendGrid provider. SendGrid is a transactional email service for OUTBOUND, plus INBOUND via the Inbound Parse Webhook (subscription management + inbound notification parsing). It does NOT support mailbox operations like fetching messages, folders, or attachments (there is no inbound-retrieval API).
Lists attachments on a message. Override in subclasses that support this operation.
Parameters for listing attachments
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Lists folders/mailboxes available in the provider. Override in subclasses that support this operation.
Parameters for listing folders
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Marks message(s) as read or unread. Override in subclasses that support this operation.
Parameters for marking messages
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Moves a message to a different folder. Override in subclasses that support this operation.
Parameters for moving the message
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Parses an inbound SendGrid Inbound Parse notification. PURE: no network calls, and
safe on hostile/garbage input — never throws; returns Success: false with a 400
suggested status on malformed payloads.
The body is multipart/form-data; the boundary is read from the
content-type header. The full parsed email is delivered inline, so this populates
NormalizedNotification.Message directly (INLINE mode — no re-fetch).
SignatureValid is always undefined: Inbound Parse has NO signature scheme. See
the class-level SECURITY CAVEAT — consumers must protect the endpoint out-of-band.
LIMITATION: binary attachment parts are intentionally NOT decoded. When attachment
parts are present, only their COUNT is recorded (RawData.attachmentCount); the
bytes are skipped. Consumers needing attachments must read the raw request directly.
Transport-neutral capture of the inbound webhook request
Optional_credentials: SendGridCredentialsUnused (no signature scheme to verify)
Promise
Renews an existing subscription before it expires. The caller MUST pass credentials for the same account/app registration used to create the subscription. Override in subclasses that support this operation.
Parameters identifying the subscription and the new expiration
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Replies to a message using the provider.
Optionalcredentials: SendGridCredentialsSearches messages using a query string. Override in subclasses that support this operation.
Parameters for searching messages
Optionalcredentials: ProviderCredentialsBaseOptional credentials override for this request
Promise
Sends a single message using SendGrid.
The processed message to send
Optionalcredentials: SendGridCredentialsOptional SendGrid credentials override
Checks if this provider supports a specific operation.
The operation to check
true if the operation is supported
Implementation of the SendGrid provider for sending and receiving messages.
Remarks
SendGrid is a transactional email service. This provider supports:
/v3/user/webhooks/parse/settings).multipart/form-dataPOST that SendGrid delivers to the consumer's URL. This is INLINE delivery: the POST body contains the ENTIRE parsed email, so NormalizedNotification.Message is populated and there is NO re-fetch (SendGrid has no inbound-retrieval API).It does NOT support:
SECURITY CAVEAT (Inbound Parse)
SendGrid Inbound Parse is unsigned — there is no cryptographic signature on the inbound POST and no expiry on the registration. Because the message is delivered inline (the payload IS the data path), a forged notification is NOT harmless. Consumers MUST protect the notification endpoint out-of-band: use a hard-to-guess URL secret path and/or network controls (IP allow-listing, private ingress). ParseNotification therefore always returns
SignatureValid: undefined(no scheme to verify).Example