How to Add a Newsletter to Your Docusaurus Site
This guide explains how to integrate BlogTally Broadcast with your Docusaurus site to automatically send newsletters based on your RSS feed.
Prerequisites
- A Docusaurus site
- A BlogTally account
- Basic knowledge of JavaScript and React
Setting up RSS Feed in Docusaurus
Docusaurus generates an RSS feed by default. You just need to ensure your blog plugin is configured correctly:
Configure RSS Feed
Add or update the blog plugin configuration in your docusaurus.config.js
:
module.exports = {
// Other configurations...
plugins: [
[
'@docusaurus/plugin-content-blog',
{
// other options
feedOptions: {
type: 'all',
title: 'Your Blog Title',
description: 'Your Blog Description',
copyright: `Copyright © ${new Date().getFullYear()} Your Name`,
language: 'en',
},
},
],
],
};
Your RSS feed will be available at /blog/rss.xml
by default.
For additional RSS feed configuration options, refer to the Docusaurus RSS documentation.
Integrating with BlogTally Broadcast
Once your RSS feed is set up, you can integrate it with BlogTally Broadcast in two steps:
1. Create a Campaign
- Navigate to the Campaigns section in your BlogTally dashboard
- Create a new RSS-based campaign
- Enter your Docusaurus blog's RSS feed URL
- 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. BlogTally provides several options:
- Use our pre-built forms
- Create a custom form
- Integrate with your existing forms
If you want to create a custom form component, here's an example:
// src/components/SubscriptionForm.js
import React from 'react';
const SubscriptionForm = () => {
return (
<form action="YOUR_FORM_URL" method="POST">
<input type="email" name="email" placeholder="Enter your email" required />
<button type="submit">Subscribe</button>
</form>
);
};
export default SubscriptionForm;
Replace YOUR_FORM_URL
with your form URL from the BlogTally dashboard.
For form creation and customization instructions, check our Forms Documentation.
Next Steps
- Learn how to customize your email templates
- Explore subscriber management features
- Set up campaign tracking
Need Help?
If you encounter any issues or need assistance, feel free to contact our support team.