Setting up

Install the Shootmail javascript SDK
npm i --save shootmail

Initialize client

import { Shootmail, type ShootMailConfig } from "shootmail";

const shootmail = new Shootmail(shootmailConfig);

Shootmail Config

This is a one time setup. These settings will be used for all the mails you send.
const shootmailConfig: ShootMailConfig = {
        shootmailApiKey: "shootmail-api-key",
        brand: {
            color: "#1A77F2",
            logo: {
                light: "https://res.cloudinary.com/curead/image/upload/c_scale,f_auto,q_auto,w_343/v1712843877/Shootmail/logos/shootm-logo-with-name_jgdq2l.png",
                dark: "https://res.cloudinary.com/curead/image/upload/f_auto,q_auto,w_343/v1713876965/Shootmail/logos/shootm-logo-with-name-dark-mode_rziumz.png",
                default: "https://res.cloudinary.com/curead/image/upload/c_scale,f_auto,q_auto,w_343/v1712843877/Shootmail/logos/shootm-logo-with-name_jgdq2l.png",
            },
            name: "Shootmail",
            website: "https://shootmail.app",
            support: {
                email: "hi@shootmail.app",
                slack: "hi@shootmail.app"
            }
        },
        socialMedia: {
            instagram: "https://shootmail.app",
            x: "https://mystorebud1.com",
            youTube: "https://mystorebud2.com",
            meta: "https://mystorebud3.com",
            linkedIn: "https://shootmail.app"
        }
};

Config Options

Optional fields, if skipped, will not be displayed in the mail
shootmailApiKey
string
required
API key generated from Shootmail Dashboard
providers
Array
Only required if you are not using shootmail as an email provider and are just using the templates to send emails from some other service like sendgrid, postmark, resend etc.
brand
Object
required
Configure your email service here, you can conifgure more than one.
socialMedia
Object
Configure your social media handles to display icons in the mail footer