How to Add a Newsletter to Your Gatsby Blog

This guide explains how to integrate Hakanai Broadcast with your Gatsby-powered blog to automatically send newsletters based on your RSS feed.

Prerequisites

  • A Gatsby blog
  • A Hakanai account
  • Basic knowledge of npm and JavaScript

Setting up RSS Feed in Gatsby

Before integrating with Hakanai Broadcast, you need to set up an RSS feed for your blog using the gatsby-plugin-feed plugin.

1. Install RSS Plugin

npm install gatsby-plugin-feed

2. Configure Plugin

Add the following configuration to your gatsby-config.js:

module.exports = {
  siteMetadata: {
    title: 'Your Blog Title',
    description: 'Your blog description',
    siteUrl: 'https://yourblog.com', // Change to your site's URL
  },
  plugins: [
    `gatsby-plugin-feed`,
    // other plugins
  ],
}

3. Customize Feed Configuration (Optional)

For advanced feed configuration options such as custom feed paths or multiple feeds, refer to the Gatsby RSS Feed documentation.

Your RSS feed will be available at /rss.xml by default.

Integrating with Hakanai Broadcast

Once your RSS feed is set up, you can integrate it with Hakanai Broadcast in two steps:

1. Create a Campaign

  1. Navigate to the Campaigns section in your Hakanai dashboard
  2. Create a new RSS-based campaign
  3. Enter your Gatsby blog's RSS feed URL (e.g., https://yourblog.com/rss.xml)
  4. Configure your campaign settings

For detailed instructions on campaign creation and management, see our Campaign Management Guide.

2. Add a Subscription Form

To collect subscribers, you'll need to add a subscription form to your blog. Hakanai provides several options:

  • Use our pre-built forms
  • Create a custom form
  • Integrate with your existing forms

For form creation and customization instructions, check our Forms Documentation.

Next Steps

Need Help?

If you encounter any issues or need assistance, feel free to contact our support team.