Setting up

Install the Shootmail javascript SDK

Initialize client

Shootmail Config

This is a one time setup. These settings will be used for all the mails you send.

const config: ShootMailConfig = {
    shootmailApiKey: "shootmail-api-key",
    providers: [
        {
            "provider": "zoho",
            "apiKey": "zoho-api-key"
        },
        {
            "provider": "resend",
            "apiKey": "resend-api-key"
        },
        {
            "provider": "sendgrid",
            "apiKey": "sendgrid-api-key"
        },
        {
            "provider": "postmark",
            "apiKey": "postmark-api-key"
        },
        {
            provider: "aws-ses",
            apiKey: {
                accessKeyId: "ses-access-key",
                secretAccessKey: "ses-secret-key",
                region: "ses-region" //us-east-1
            }
        },
        {
            provider: "emailit",
            apiKey: "emailit-api-key"
        }
    ],
}

Sending Mail

const response = await shootmail.shoot({
    preHeader: "Huge price drop!",
    templateId: "sEO94SOnDhBIqvggZSS4C", // your template ID
    from: {
        name: "Shootmail",
        email: "updates@mail.shootmail.app",
    },
    provider: "resend",
    to: [{ email: "sps.1431990@gmail.com" }],
    subject: "Shootmail price drop",
    data: {
        button: "Explore Now"  // custom variables
    }
});