Website Building » WooCommerce » How Do I Connect MailerLite to WooCommerce?

How Do I Connect MailerLite to WooCommerce?

Last updated on October 1, 2022 @ 4:43 pm

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:

PRO TIP: If you are not careful, connecting your MailerLite account to WooCommerce can result in some serious problems. For example, if you accidentally connect the wrong MailerLite account to your WooCommerce store, you could end up inadvertently sending out marketing emails to all of your customers. Additionally, if you do not properly configure the connection between MailerLite and WooCommerce, you could end up with duplicate email addresses in your MailerLite account, which could lead to a lot of confusion and wasted time trying to sort out the mess.
$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.

Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.