class SendGridProvider
implements MailProvider
Since 0.1.0

SendGrid provider over fetch.

Constructors

SendGridProvider(options?: SendGridProviderOptions)
Parameters
optional
options: SendGridProviderOptions

SendGrid connection/injection options

Methods

connect(): Promise<void>

Establishes any backing connection/client. No-op for stateless providers.

disconnect(): Promise<void>

Releases any backing connection/client. No-op for stateless providers.

Since 0.1.0
isHealthy(): Promise<boolean>

M70c: a GET /v3/scopes through the existing IMailHttp seam. 2xx means the key is valid; 401 means the API reached us (so the backend is reachable even though the key is wrong); any other status or a network failure means unreachable.

isReady(): boolean

Reports whether the provider is ready to send.

send(message: OutgoingMail): Promise<void>

Sends a message via the SendGrid v3 API.

Usage

import { SendGridProvider } from "mail-plugin/src/index.ts";