src/sendgrid.ts

email-sdk · packages/email-sdk/src/sendgrid.ts · typescript · MIT
email

Module exposing: sendgrid, sendgridPersonalizations, recipientSubstitutions

// Source: https://github.com/opencoredev/email-sdk | License: MIT | Copyright 2026 OpenCore
// Provided via justclaw.it.com; keep this notice with the code.
import { firstString, jsonProvider } from "./http.js";
import {
  apiAddress,
  apiAddresses,
  commonHeadersObject,
  optionalApiAddresses,
  recipientVariableEntries,
  sendAtUnixSeconds,
  sendgridAttachments,
} from "./payloads.js";
import type { EmailMessage, EmailAdapter } from "./types.js";
import { arrayify, assertMaxItems, emailAddressOf, hasRecipientVariables } from "./utils.js";

export type SendGridAdapterOptions = {
  apiKey: string;
  baseUrl?: string;
  fetch?: typeof fetch;
};

export function sendgrid(
  options: SendGridAdapterOptions,
): EmailAdapter<"sendgrid", { baseUrl: string }> {
  const provider = jsonProvider

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key