Setup

This was designed for my netlify blog that has an rss feed. It grabs the submissions for the blog and emails the subscribers about the new post.

Setting up form on Netlify site is easy

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

Prerequisites

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)

Clone Repository

git clone https://github.com/andrejarrell/Mailer.git

Open Directory

cd Selfbot

Download Dependencies

npm install

Setup Environment Variables

Create a file named .env

In the .env file you don't use quotes

.env
# You can create a token here:
# https://app.netlify.com/user/applications/personal
NETLIFY_TOKEN=
# Most SMTP providers offer generous free tiers (I use gmail)
SMTP_HOST=
SMTP_USER=
SMTP_PASS=
# The current domain of your site (ex: blog.andre.gg)
SITE_DOMAIN=
# The email you want to send as and for people to reply to
YOUR_EMAIL=

Run Application

node index

Email Example

get
Site Submissions

https://api.netlify.com/api/v1/sites/:site/submissions
Gets form submissions from a Netlify site
Request
Response
Path Parameters
site
required
string
Site API ID or Site Domain
Query Parameters
access_token
required
string
Access Token for API
200: OK
[
{
"number": 1,
"title": "Andre Jarrell",
"email": "[email protected]",
"name": "Andre Jarrell",
"first_name": "Andre",
"last_name": "Jarrell",
"company": null,
"summary": "<strong>Andre Jarrell</strong> ",
"body": null,
"data": {
"name": "Andre Jarrell",
"email": "[email protected]",
"ip": "99.132.88.296",
"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": "https://blog.andre.gg/"
},
"created_at": "2019-03-31T07:48:56.548Z",
"human_fields": {
"Name": "Andre Jarrell",
"Email": "[email protected]",
},
"ordered_human_fields": [
{
"title": "Name",
"name": "name",
"value": "Andre Jarrell",
},
{
"title": "Email",
"name": "email",
"value": "[email protected]",
}
],
"id": "5cajh0e87be0e66e7ja888f1",
"form_id": "5cac708s35hd450009309g05",
"site_url": "http://blog.andre.gg",
"form_name": "subscribe"
}
]

RSS FEED

GET: https://blog.example.com/feed.json