Stripe to MailerLite Integration
A WordPress plugin that provides an endpoint to connect Stripe & Mailerlite, to automate checkout subscriptions.
by Ryan T. M. Reiffenberger · github.com/reclaimergold/wp-stripe-to-mailerlite · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/reclaimergold/wp-stripe-to-mailerlite/archive/refs/heads/main.zipAuthor URL: Falls Technology Group
Description: Automatically subscribes Stripe checkout customers to specified MailerLite mailing lists.
Overview
The Stripe to MailerLite Integration plugin allows you to automatically add customers who complete a Stripe checkout session to designated mailing lists in MailerLite. This can help streamline your email marketing efforts by ensuring that customers are automatically subscribed to relevant lists based on the products they purchase.
Features
- Map specific Stripe products to MailerLite groups
- Automatically subscribes customers to appropriate MailerLite groups after checkout
- Easy configuration through the WordPress dashboard
- Securely authenticates Stripe webhook requests
Requirements
- WordPress installation
- Stripe account with API keys and enabled webhooks
- MailerLite account with API key
- PHP 7.4 or higher
Installation
- Download the plugin or clone this repository into your WordPress plugins directory (
wp-content/plugins/). - Activate the plugin through the WordPress dashboard under Plugins > Installed Plugins.
- Configure your API keys and product mappings under Settings > Stripe to MailerLite.
Setup
API Configuration
- Go to Settings > Stripe to MailerLite in your WordPress dashboard.
- Enter your Stripe Secret Key, Stripe Webhook Secret, and MailerLite API Key in the provided fields.
- Save changes.
Webhook Configuration
- In your Stripe account, go to Developers > Webhooks and create a new webhook.
- Set the endpoint URL to your WordPress site, appending
/wp-json/smi/v1/webhook(e.g.,https://yourwebsite.com/wp-json/smi/v1/webhook). - Choose the
checkout.session.completedevent. - Copy the Webhook Secret provided by Stripe and enter it in the plugin settings.
Product to Mailing List Mapping
- In the plugin settings page, you’ll see a list of your Stripe products alongside available MailerLite groups.
- Select the MailerLite group to associate with each Stripe product. When a customer purchases this product, they’ll be added to the corresponding MailerLite group.
Usage
Once configured, the plugin will automatically subscribe customers to the appropriate MailerLite group(s) upon completing a Stripe checkout session. No further actions are required.
Troubleshooting
- Product List Empty: Ensure your Stripe Secret Key is correct and has permissions to fetch products.
- MailerLite Group List Empty: Verify the MailerLite API Key and ensure it has permissions to access groups.
- Webhook Not Triggering: Confirm that the webhook endpoint is set correctly in Stripe and that the
checkout.session.completedevent is enabled.
Development
File Structure
stripe-mailerlite-integration.php: Main plugin filesmi_add_settings_page(): Registers the settings page in WordPresssmi_render_settings_page(): Renders the settings pagesmi_handle_stripe_webhook(): Handles incoming Stripe webhookssmi_add_to_mailerlite(): Adds subscribers to MailerLite groups
Code Overview
The plugin uses WordPress REST API routes and settings pages to handle configuration, webhook processing, and customer subscriptions.
License
This plugin is open-source and released under the MIT License.
Support
For assistance, please contact Falls Technology Group.