All Projects → bdcorps → Candymail

bdcorps / Candymail

Licence: mit
Email Automations for Node.js

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Candymail

Colossus
Self-hosted email marketing solution
Stars: ✭ 319 (+95.71%)
Mutual labels:  automation, email-marketing
Autospotting
Saves up to 90% of AWS EC2 costs by automating the use of spot instances on existing AutoScaling groups. Installs in minutes using CloudFormation or Terraform. Convenient to deploy at scale using StackSets. Uses tagging to avoid launch configuration changes. Automated spot termination handling. Reliable fallback to on-demand instances.
Stars: ✭ 2,014 (+1135.58%)
Mutual labels:  automation
Backport
A simple CLI tool that automates the process of backporting commits on a GitHub repo
Stars: ✭ 154 (-5.52%)
Mutual labels:  automation
Syncd
syncd是一款开源的代码部署工具,它具有简单、高效、易用等特点,可以提高团队的工作效率.
Stars: ✭ 2,065 (+1166.87%)
Mutual labels:  automation
Securecrt Tools
SecureCRT scripts, written in Python, for doing various tasks when connected to Cisco equipment.
Stars: ✭ 154 (-5.52%)
Mutual labels:  automation
Aenigma
The | state-of-the-art | secure-by-default | one-touch-deployed | XMPP server for everyone.
Stars: ✭ 160 (-1.84%)
Mutual labels:  automation
Maintainer
👨‍💻 🐳 Generate personal daily reports or summary, AUTHORS, CONTRIBUTING, CHANGELOG and so on for GitHub user or repository.
Stars: ✭ 152 (-6.75%)
Mutual labels:  automation
Patrowlengines
PatrOwl - Open Source, Free and Scalable Security Operations Orchestration Platform
Stars: ✭ 162 (-0.61%)
Mutual labels:  automation
Terrible
An Ansible playbook that apply the principle of the Infrastructure as Code on a QEMU/KVM environment.
Stars: ✭ 161 (-1.23%)
Mutual labels:  automation
Coqhammer
CoqHammer: An Automated Reasoning Hammer Tool for Coq - Proof Automation for Dependent Type Theory
Stars: ✭ 157 (-3.68%)
Mutual labels:  automation
Licenseplist
A license list generator of all your dependencies for iOS applications
Stars: ✭ 1,996 (+1124.54%)
Mutual labels:  automation
Scheduler Card
HA Lovelace card for control of scheduler entities
Stars: ✭ 154 (-5.52%)
Mutual labels:  automation
Dro Matic
Fully Automated Hydroponic OS for DIY DRO-Matic cabinets - Nutrient dosing, irrigation, topoffs, timers, EC & pH drift fixing.
Stars: ✭ 160 (-1.84%)
Mutual labels:  automation
Qxf2 Page Object Model
Write Selenium and Appium tests in Python using the Page Object pattern. This Pythonic GUI and API test automation framework will help you get started with QA automation quickly. It comes with many useful integrations like - email, BrowserStack, Slack, TestRail, etc. This repository is developed and maintained by Qxf2 Services (https://qxf2.com).
Stars: ✭ 155 (-4.91%)
Mutual labels:  automation
Kasaya
A "WYSIWYG" (sort of) scripting language and runtime for browser automation
Stars: ✭ 1,906 (+1069.33%)
Mutual labels:  automation
Adaptive Lighting
Adaptive Lighting custom component for Home Assistant
Stars: ✭ 151 (-7.36%)
Mutual labels:  automation
Flashsploit
Exploitation Framework for ATtiny85 Based HID Attacks
Stars: ✭ 155 (-4.91%)
Mutual labels:  automation
Github Actions Runner Operator
K8S operator for scheduling github actions runner pods
Stars: ✭ 159 (-2.45%)
Mutual labels:  automation
Crud
CRUD is Really Urgly coDed -- 万能快速原型系统
Stars: ✭ 162 (-0.61%)
Mutual labels:  automation
Netbox As Ansible Inventory
Ansible dynamic inventory script for Netbox.
Stars: ✭ 161 (-1.23%)
Mutual labels:  automation

NPM npm npm David

CandyMail - Email Automation for Node.js

Candymail makes it easy to trigger and send multi-step email sequences in Node.js using a single JSON file. Built for bootstrappers, indie makers with special care.

New in 1.0.12

  • Add HTML in body
  • Unsubscribe Option added to email footer
  • Full Typescript Support

Features

  1. Portable: Create, share and reuse email marketing strategies between different products
  2. Simple to use: Time to send, subject, body of the emails can all be set up in a single JSON file
  3. Free: No need to pay for monthly Mailchimp etc. payments for email automation plans

Use Cases

  • Build better onboarding by guiding the user through the app with paced training emails
  • Reduce churn by sending exciting community content every few days
  • Convert more customers to paid plans by offering discounts based on the user's usage activity

Installation

Install candymail using yarn:

yarn add candymail

Or npm:

npm install --save candymail

Getting Started

Configuration

Create a candymail.automation.json file on the root level of your project.

Here's a sample:

{
  "automations": [
    {
      "name": "automation1",
      "description": "tell users about pro features",
      "trigger_name": "proplan",
      "emails": [
        {
          "trigger": "time",
          "sendDelay": 1,
          "subject": "Have you tried Feature A?",
          "body": "Feature A will let you do ABC things. <p>We can also do HTML!</p>",
          "from": "[email protected]"
        },
        {
          "trigger": "time",
          "sendDelay": 3,
          "subject": "Try our feature B!",
          "body": "We released feature B just last week and can't wait for you to try it out :)",
          "from": "[email protected]"
        }
      ]
    }
  ]
}

Supported Email Providers

  • Gmail
  • Looking for more support? Send me a message.

Simple Usage

require('dotenv').config()
const candymail = require('candymail')
const automations = require('../candymail.automation.json')

candymail.init(automations.automations, {
  mail: {
    host: 'smtp.gmail.com',
    port: 465,
    secure: true,
    auth: {
      user: process.env.MAIL_USER,
      pass: process.env.MAIL_PASSWORD,
    },
    tls: {
      rejectUnauthorized: true,
    },
  },
  hosting: { url: process.env.HOSTING_URL },
})

candymail.start()

// candymail.unsubscribeUser('[email protected]') // Immediatedly unsubscribe user and they will not receive any more messages

const someConditionSatisfiedByUser = () => {
  const user = process.env.RECIPIENT_EMAIL
  candymail.runAutomation('automation1', user)
  console.log({ get: candymail.getAllScheduledMessages() })
}

someConditionSatisfiedByUser()

Usage with Express Server

require('dotenv').config()
const candymail = require('../../lib')
const express = require('express')
const app = express()
const port = 3000

const automations = require('../candymail.automation.json')
candymail.init(automations.automations, {
  mail: {
    host: 'smtp.gmail.com',
    port: 465,
    secure: true,
    auth: {
      user: process.env.MAIL_USER,
      pass: process.env.MAIL_PASSWORD,
    },
    tls: {
      rejectUnauthorized: true,
    },
  },
  hosting: { url: process.env.HOSTING_URL },
})

candymail.start()

app.get('/', (req, res) => {
  const user = process.env.RECIPIENT_EMAIL
  candymail.runAutomation('automation1', user)

  res.send(
    `Welcome to Candymail Demo. Messages scheduled: ${JSON.stringify(
      candymail.getAllScheduledMessages()
    )} `
  )
})

app.get('/unsubscribe', (req, res) => {
  const { email } = req.query
  candymail.unsubscribeUser(email)
  res.send(`Sent a unsubscribe request for ${email}`)
})

app.listen(port, () => {
  console.log(`Learn about our new features at http://localhost:${port}`)
})

Note: Having problems with Gmail? Enable Allow less secure apps in Google Account settings here.

Automation File Options

Property Required Description
trigger No Name of the trigger (Not usable)
sendDelay Yes Delay after which the email will be sent (in hours). From time 0, not from the last email
subject Yes Subject of the email
body Yes Body of the email: HTML or Text
from Yes Sender's Email Address

Methods

init (automations, options)

Loads up all the automations and the options.

  • automations: Automations to be run.

  • options: { mail: { host: 'smtp.gmail.com', port: 465, secure: true, auth: { user: process.env.MAIL_USER, pass: process.env.MAIL_PASSWORD, }, tls: { rejectUnauthorized: true, }, }, hosting: { url: process.env.HOSTING_URL }

start()

Starts the internal timer that will send emails at appropriate times.

runAutomation(automationName)

Triggers an automation based on name specified in the candymail.automation.json file. Needs candymail.start() to have been called.

  • automationName: Name of automation in candymail.automation.json. Example: 'automation1'.

getAllScheduledMessages()

Get the list of all scheduled messages.

getScheduledMessagesAtTime(time)

Get the list of scheduled messages for a particular time.

  • time: Time should be specified in this format: MM/DD/YYYY:HH. For Example: 8/20/2020:2.

clearAllScheduledMessages()

Clears all scheduled messages.

stop()

Stops the internal timer. Can be restarted with candymail.start()

destroy()

Destroys the internal timer.

unsubscribeUser(email)

Unsubscribes a user's email. No further emails will be sent out to the user.

Notes

  1. Only the hour value will be used in the cron, minutes will be ignored. +1 hour at 11:58 is 12.
  2. Object keys: MM/DD/YYYY:HH. Hours are specified in 24-hour format.
  3. There is currently no Unsubscribe option in the emails. Being worked on right now.
  4. Only supports GMail. More providers being added right now.

Looking to contribute?

Read the CONTRIBUTING.md and pick up issues to work on from the Project Roadmap here.

Got Feedback? Hit me up at [email protected]
Now available for freelance work.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].