How to create a newsletter for a blog
Docswrite Team
Aug 25, 2022
1 min read
A few days ago I announced that there will be an inbuilt newsletter feature for docswrite.com blogs. I had to offer this because a blog without email and newsletter is just a home without family.
I started working on it a few days back and mostly explored all the available emailing options. There are many big players in the market for email solutions. There are like many many options.
I finally decided that I will use https://www.mailgun.com
Creating an emailing list is easier
mg.lists.create({ address: '[email protected]', name: 'Sandeep Acharya', description: 'Mailing lists for repliable address', access_level: 'readonly', reply_preference: 'sender', });
Adding an email to mailing list
mg.lists.members.createMember('[email protected]', { address: '[email protected]', name: 'Subhashree Chakraborty', subscribed: 'yes', upsert: 'yes', });
Sending an email to a list
const data = { from: 'Pub Company ', to: '[email protected]', subject: 'Awesome work', text: 'Another email from me', }; await mg.messages.create(DOMAIN, data);
I found the API to be very straightforward. I am now trying to figure out what happens if someone tries replying to a list. Mailgun Routes can be a solution. If you enjoy this blog, you may try starting a blog.
← Back to Blog