https://github.com/arn4v/dakiya
Simple email automation library for Node.js
https://github.com/arn4v/dakiya
email-scheduling marketing-automation
Last synced: 2 months ago
JSON representation
Simple email automation library for Node.js
- Host: GitHub
- URL: https://github.com/arn4v/dakiya
- Owner: arn4v
- Created: 2022-09-03T14:14:34.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-06T11:19:11.000Z (almost 3 years ago)
- Last Synced: 2024-11-03T11:50:39.970Z (8 months ago)
- Topics: email-scheduling, marketing-automation
- Language: TypeScript
- Homepage: https://npmjs.com/package/dakiya
- Size: 1000 KB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dakiya

_Simple_ email automation for Node.js _made easy_.
## Features
- **Zero config management**: Use simple, chainable code to create email sequences.
- **Email platform agnostic**: Only SMTP credentials required.## Roadmap
1. [ ] Compliance Features (Unsubscribing)
2. [ ] Custom conditionals support
3. [ ] Tracking Opens
4. [ ] Self-hostable web interface## Example Ussage
```typescript
import { Sequence, Scheduler } from "dakiya";
import { z } from "zod";const welcomeVariablesSchema = z.object({
name: z.string(),
verificationUrl: z.string(),
});enum EmailSequence {
Onboarding = "onboarding",
}export const onboarding = new Sequence(
EmailSequence.Onboarding,
welcomeVariablesSchema
)
.waitFor("5m")
.sendMail({
subject: "Welcome to {Product Name}!",
html({ name }) {
return `Hi ${name}, Welcome to {Product Name}`; // Email HTML
},
})
.sendMail({
subject: "Verify Your Email",
html({ verificationUrl }) {
return "";
},
})
.waitFor("1d")
.sendMail({
subject: "Access {Product Name} On The Go!",
html({ name }) {
const downloadUrl = "";
return `Hi ${name}, Access {Product Name} on the go using our mobile app. Download for iOS: ${downloadUrl}`
}
});export const scheduler = new Scheduler([onboarding], {
mongoUri: "", // mongodb connections string
transportOpts: {}, // nodemailer transport options
waitMode: "stack"
});await scheduler.initialize();
await scheduler.schedule(
EmailSequence.Onboarding,
{ name: "", verificationUrl: "" },
// Nodemailer SendMailOptions
{
to: "",
from: "",
}
);
```