Email Alerting

Alternatives To Email Alerting
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Learn To Send Email Via Google Script Html No Server2,956225 months ago3March 06, 201819gpl-2.0HTML
:email: An Example of using an HTML form (e.g: "Contact Us" on a website) to send Email without a Backend Server (using a Google Script) perfect for static websites that need to collect data.
Elasticsearch Gmail1,976
a year ago1Python
Index your Gmail Inbox with Elasticsearch
Ember Auth Rails Demo124
10 years ago1Ruby
rails + devise + ember-auth demo site
Aws Ses Node Js Examples75
6 years ago4JavaScript
Tutorial on using the AWS SES API to generate emails with attachments, create/list/delete verified senders. We will be using NodeJS as our primary language but it can be done using any language the AWS SDK supports.
Build An Html Email Template From Scratch68
2 years ago5HTML
Exercise files for Tuts+ tutorial: Build an HTML Email Template From Scratch
Tensorflow Tutorial48
3 years ago1mitPython
Code for email classification in TensorFlow.
Food Order App40
6 months ago24mitVue
Simple Food Ordering Website (NodeJS, ExpressJS, MongoDB, Bootstrap) with auto deployment
Aspnet Core Mvc38
3 years ago1mitC#
Asp.Net Core MVC 3.1 tutorial with Live application | Nitish
Django Allauth Tutorial22
7 years agomitJavaScript
Email, Username, and Social Authentication made easier.
3 years agoDart
Alternatives To Email Alerting
Select To Compare

Alternative Project Comparisons


What is this?

This is a tutorial for setting up email alerts on your application using Mandrill, a delivery API for sending transactional emails from websites and applications.

Depending on your objectives, you'll want to start at different points in this tutorial. The first part of the tutorial is a basic introduction to using Mandrill front-end, whereas the second part of the tutorial is more practical for using it server-side with hapi. It's worth going through the process front-end before you graduate to back-end email alerting.

Why use Mandrill?

Mandrill is a very popular API for sending transactional emails, run by MailChimp: one of the tech industry's largest email marketing providers. The first 12,000 emails per month are free.

Front-end tutorial

This tutorial will teach you how to send an email from the front-end of your website, with no server-side coding necessary. All credit to this tutorial for teaching us how to do it first (and providing the sample code).

Step 1: get an API key

Register for Mandrill. Sign in to get an API key on the "Settings" page.

Step 2: load jQuery

You will need jQuery for this tutorial (although you're welcome to write your own AJAX call or use another library). Load it in script tags at the bottom of your HTML file.

<script src="//">

Step 3: use the $.ajax function to send an email

Write an AJAX request to the Mandrill API like so. Full list of message parameters can be found here.

  type: “POST”,
  url: “”,
  data: {
    ‘key’: ‘YOUR API KEY HERE’,
    ‘message’: {
      ‘from_email’: ‘[email protected]’,
      ‘to’: [
            ‘email’: ‘[email protected]’,
            ‘name’: ‘RECIPIENT NAME (OPTIONAL)’,
            ‘type’: ‘to’
            ‘email’: ‘[email protected]’,
            ‘name’: ‘ANOTHER RECIPIENT NAME (OPTIONAL)’,
            ‘type’: ‘to’
      ‘autotext’: ‘true’,
      ‘subject’: ‘YOUR SUBJECT HERE!’,
 }).done(function(response) {

Optional Step 4: make this happen on click of a button

You might want to send the email when a button is clicked. You can do this like so.

$('#yourButtonId').click(function() {
   // insert your AJAX request here


This method is really just to illustrate the concept of communicating with the Mandrill API. Doing this process front-end is not a good idea, as your API key will be visible to everyone visiting your site.

Back-end tutorial

This part of the tutorial will show you how to send email alerts server-side using hapi and the Mandrill Node.js API.

Step 1: make the request on the client side

Make a post request to send the emails. We did this using jQuery, like so:

$('#send').click(function() {
  type: 'POST',
  url: '/signup',
  data: {
    "email": $("#email").val()
 }).done(function(response) {
   console.log("testing"); // if you're into that sorta thing

Step 2: set up the hapi server

Set up a simple hapi server with two routes: one to fetch the index.html file, and another to receive the post request with the email address.

You'll see we require hapi and the Mandrill API. We've also stored the API key in an environment variable called "SECRET".

var Hapi = require("hapi");
var server = new Hapi.Server();
var mandrill = require("mandrill-api/mandrill");
var mandrill_client = new mandrill.Mandrill(process.env.SECRET);

	port: Number(process.argv[2] || 3000),
	host: "localhost"

	method: "GET",
	path: "/{filename}",
	handler: {
		file: function(request){
			return request.params.filename;

	method: "POST",
	path: "/signup",
	config: {
		handler: function(req, res) {

Step 3: set up a function to send the email using the Mandrill API

Write a function to send the email, using the Mandrill API. This function "sendEmail" sends posts requests to the Mandrill client which in turn sends the email to the user.

function sendEmail(email) {
	var data = {

	      	'from_email': '[email protected]',
	      	'to': [
	            'email': email,
	            'name': 'dan',
	            'type': 'to'
		      'autotext': 'true',
		      'subject': 'YOUR SUBJECT HERE!',
	mandrill_client.messages.send({"message": data, "async": false},function(result) {
	}, function(e) {
		console.log("Error " + e.message);

Step 4: start the server

Start the server with "server.start" which listens for requests from the client.

server.start(function(err) {
	if(err) {
	console.log("Server is running");

How to run the demo

The files in this repo are the demo we built for the back-end tutorial. You can run the project yourself by cloning the repo and running it on a server.

You will need to have node.js, nodemon and hapi installed, plus a basic understanding of git and your terminal to get this working.

1. Clone the repo

git clone

2. Install the node.js dependencies:

npm install

3. Run the Server with Nodemon:

nodemon server.js

4. Go to localhost:3000 in your browser.

Popular Tutorials Projects
Popular Email Projects
Popular Learning Resources Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.