Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
167 lines (129 sloc) 4.4 KB
Sends the latest post from the RSS feed to the Netlify subscribers

Mailer - Github

dependenciesversion commit license

{% embed url="" caption="Source code here" %}


Git and Node.js will need to be installed. You will need a decent Code Editor. And also a decent understanding of the Command Line Interface. (Powershell works fine on Windows)


This was designed for my Netlify Blog that had an RSS feed. It grabs the subscriptions from the blog and emails the subscribers about my most recent post.

To create the contact form use this snippet:

<form name="subscribe" method="POST" data-netlify="true">
        <label>Your Name: <input type="text" name="name" minlength="3" required/></label>   
        <label>Your Email: <input type="email" name="email" required/></label>
        <button type="submit">Send</button>

To download the code use this command:

git clone mailer

Open the directory and install the required dependencies.

cd mailer
npm i

Create a file named .env

{% code title=".env" %}

# You can create a token here:


# Most SMTP providers offer generous free tiers (I use gmail)


# The current domain of your site (ex:


# The email you want to send as and for people to reply to


{% endcode %}

Fill in the required settings (no quotes needed in .env file)


node index.js


Example of what the email looks like when it is sent


{% api-method method="get" host="" path=":site/submissions" %} {% api-method-summary %}

{% endapi-method-summary %}

{% api-method-description %} Get form submissions from Netlify site {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="site" type="string" required=true %} Site API Id or site domain {% endapi-method-parameter %} {% endapi-method-path-parameters %}

{% api-method-query-parameters %} {% api-method-parameter name="access_token" type="string" required=true %} Access token for API {% endapi-method-parameter %} {% endapi-method-query-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %}

{% endapi-method-response-example-description %}

        "number": 1,
        "title": "Andre Jarrell",
        "email": "",
        "name": "Andre Jarrell",
        "first_name": "Andre",
        "last_name": "Jarrell",
        "company": null,
        "summary": "<strong>Andre Jarrell</strong> ",
        "body": null,
        "data": {
            "name": "Andre Jarrell",
            "email": "",
            "ip": "",
            "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
            "referrer": ""
        "created_at": "2019-03-31T07:48:56.548Z",
        "human_fields": {
            "Name": "Andre Jarrell",
            "Email": "",
        "ordered_human_fields": [
                "title": "Name",
                "name": "name",
                "value": "Andre Jarrell",
                "title": "Email",
                "name": "email",
                "value": "",
        "id": "5cajh0e87be0e66e7ja888f1",
        "form_id": "5cac708s35hd450009309g05",
        "site_url": "",
        "form_name": "subscribe"

{% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

You can’t perform that action at this time.