index.ts from strapi/strapi
// Source: https://github.com/strapi/strapi | License: MIT | Copyright 2015-present Strapi Solutions SAS
// Provided via justclaw.it.com; keep this notice with the code.
import assert from 'node:assert';
import formData from 'form-data';
import Mailgun, { type MailgunClientOptions } from 'mailgun.js';
interface Settings {
defaultFrom: string;
defaultReplyTo: string;
}
interface SendOptions {
from?: string;
to: string;
cc: string;
bcc: string;
replyTo?: string;
subject: string;
text: string;
html: string;
[key: string]: unknown;
}
type ProviderOptions = MailgunClientOptions & {
domain: string;
};
const DEFAULT_OPTIONS = {
username: 'api',
};
export default {
init(providerOptions: ProviderOptions, settings: Settings) {
assert(providerOptions.key, 'Mailgun
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key