There are two ways to connect your MailerLite account to WooCommerce. The first is through the use of our official plugin, and the second is by manually adding a few lines of code to your site. Below we’ll outline both methods so you can choose the one that’s right for you.
Method 1: Use Our Plugin
Our plugin is the easiest way to connect your MailerLite account to WooCommerce. Simply download and install the plugin, then enter your MailerLite API key in the settings page. Once connected, you’ll be able to choose which lists and groups you’d like to subscribe customers to.
Method 2: Manually Add Code
If you prefer not to use a plugin, you can connect your MailerLite account to WooCommerce by adding a few lines of code to your site. First, you’ll need to generate a MailerLite API key, which you can do by following these instructions. Once you have your API key, add the following code snippet to your site:
$mailerlite = new \MailerLite\MailerLite("YOUR-API-KEY");
$subscriber = $mailerlite->subscribers()->create([
'email' => 'john@doe.com',
]);
Replace “YOUR-API-KEY” with your actual MailerLite API key, and “john@doe.com” with the email address of the subscriber you want to add. You can add this code snippet to any place on your site where you want to capture email addresses (for example, in your signup form).
Conclusion
Connecting MailerLite to WooCommerce is easy, whether you use our plugin or manually add code to your site. Both methods only take a few minutes to set up, and once connected, you’ll be able to start building your email list and sending newsletters with ease. [related-posts id="231544, 212363, 304263, 248770, 248747, 248656, 179427, 231532, 294668, 184011"]