Newsletter
You can add a newsletter to your blog to keep your readers updated when you publish new content.
The tricky part here is that this blog is a static site, so you can't use a traditional newsletter service, or you'll have to manually send out emails every time you publish a new post and that's not very practical.
Instead, you can use a RSS-to-email service to create a newsletter and then add a form to your blog to allow your readers to sign up. Hakanai was built for this purpose, it's a SAAS that sends an email every time you publish a new post.
Of course you can use another service, here you'll find an example of how to do it with Hakanai but please feel free to use any other service you like.
Enable RSS feed
The RSS feed is enabled by default in this blog, you can find it at /rss.xml. You can check it by going to https://yourblog.com/feed.xml.
Create a newsletter on Hakanai
- Create an Hakanai account.
- Create a new campaign from your RSS feed.
- Go to the forms section and create a new form. You can create a simple form with just an email field.
Don't worry about the design, but copy and paste the form action URL. You should use the API action URL, which looks like this:
https://broadcast.hakanai.io/api/campaign/YOUR_CAMPAIGN_ID/subscribe
Add the form to your blog
You just have to enable the newsletter section in the app/app.config.ts file and add the form action URL you copied before.
newsletter: {
enabled: true,
provider: "hakanai",
form_action: "YOUR_FORM_ACTION_URL",
}
The provider can be:
hakanai: the email is sent as a query parameter to the form action URL (POST {form_action}?email=...).mailerlite: the email is posted as form data. This is also the fallback for any unknown value.demo: a fake provider that will just show a success message when the form is submitted, without calling anything.
And voilà! You have a newsletter for your static blog. People can sign up, and they'll receive an email every time you publish a new post.