shootmail
v2.1.7
Published
Shootmail is a template-first mail platform for developers, with scheduling and advanced analytics. Template-first because Shootmail has a growing list of beautiful and well-tested email templates ready to send. These templates are tested to work with maj
Downloads
89
Readme
What is Shootmail?
Shootmail is a template-first mail platform for developers, with scheduling and advanced analytics. Template-first because Shootmail has a growing list of beautiful and well-tested email templates ready to send. These templates are tested to work with major email clients like Apple Mail, Outlook, Gmail etc, also support dark mode. website
API Keys
You can generate you API key(s) from the Shootmail Dashboard
Supported Email Providers
- Resend
- Postmark
- SendGrid (Twilio)
- Zoho
More providers are being added. If you want any provider to be added on priority, let us know.
Docs
For complete documentation, checkout our docs
Usage
Install the Shootmail javascript SDK
npm i --save shootmail
Initialize client
import { Shootmail, type ShootMailConfig } from "shootmail";
const shootmail = new Shootmail(shootmailConfig);
OR
const { Shootmail } = require("shootmail");
const shootmail = new Shootmail(shootmailConfig);
For configuration options, checkout docs
Shooting Mails
const response = await shootmail.shoot({
templateId: "kthiazpqofgnrtm", //your template id
from: {
name: "Shootmail",
email: "[email protected]"
},
provider: "resend",
to: [{ email: "[email protected]" }],
subject: "Regarding your Shootmail subscription",
data: {...} // your custom variables
});
Scheduling
Pass a delay
parameter to the shootmail.shoot({...})
method to schedule mail for upto 1 year in the future. The delay
parameter accepts time in seconds.
const response = await shootmail.shoot({
templateId: "kthiazpqofgnrtm",
from: {
name: "Shootmail",
email: "[email protected]"
},
delay: 2*60*60 //send after 2 hrs
provider: "resend",
to: [{ email: "[email protected]" }],
subject: "Regarding your Shootmail subscription",
variables: [...]
});
Undo
Pass the requestId
received while scheduling the mail to undoSchedule
method.
const response = await shootmail.undoSchedule("dlsmlds2ddk3kdmsmdk");