How to Connect MailJet on Magento 2?

Avatar image of Maarten Maarten
November 7, 2022
Email marketing is one of the most reliable marketing strategies you can use for your Magento 2 e-commerce store. It can help you engage with your customers and increase your sales. Choosing the right tool for email marketing is crucial as there seem to be a lot of them out there.

Email marketing is one of the most reliable marketing strategies you can use for your Magento 2 e-commerce store. It can help you engage with your customers and increase your sales. Choosing the right tool for email marketing is crucial as there seem to be a lot of them out there.

But don’t worry, we got you covered. We have found the best email marketing tool for Magento 2.

Mailjet is one of the leading email automation tools for Magento users. With Mailjet for Magento, sending emails is now as easy as sending a tweet. Your customer’s feedback will never escape your sight with Mailjet’s advanced reporting features. If you’re a Magento customer, then you need Mailjet!

What can you do with Mailjet?

Get into Customer’s Inbox

Most promotional emails end up in either the Promotional folder or Spam box, but not with Mailjet; Mailjet helps you get right into your customer’s inbox. Using Mailjet’s SMTP relay, you can improve your deliverability.

Identify and target prospects

Target your high potential customers at the right time with a personalized email.

Drag-and-drop newsletter editor

Mailjet offers 30+ newsletter templates to help you create marketing campaigns within minutes. 

Powerful Dashboard

Send, track and optimize your email strategy using Mailjet.

Install and Configure Mailjet Extension

How to Install Mailjet Extension?

  1. Back up your database- just to make sure that no undesired changes would occur
  2. Set up Cron job. Refer to this document to set it up
  3. Log in to SSH and go to your store root directory
  4. Enable Maintenance mode using the following command
php bin/magento maintenance:enable
  1. Upload your module’s file with the composer or via FTP

Steps to upload via  FTP:

  • Go to Magento store purchases & download your module archive
  • Use Filezilla or another FTP client & Connect to your hosting server 
  • Go to your_store_root_directory/app/code
  • Create a folder “Mailjet” and enter it
  • In this folder, create a new folder, “Mailjet” and enter it
  • Extract the files on your PC
  • Upload the module’s files to the opened directory on the FTP client
  • Go to your CLI and download the Mailjet library using this command composer require mailjet/mailjet-apiv3-php

Steps to upload with composer:

  • In your Magento project, update the composer.json file with the name of the extension
  • Add the extension’s name and version to your composer.json file and download the required package
composer require mailjet/mailjet-magento2–no-update
composer update mailjet/mailjet-magento2
  • Enter your authentication keys. Your public key will be your username; your private key will be your password:
  • To get your authentication keys, navigate to Magento Marketplace > Your name > My Profile
nVQKSwtzEG87ngGxWudAZPxZi4Pu JoHJbmv3tFp8olP Cmz1 XPOvWEghN4rOby1Zn9qF0 zn6seQDFU1ypQ slCkBELQN1Ia1opQh4RmvnewnUcbXdSqMdc5o 9qCOIx H6Wm82GpjorIXSpOOa3w1AaGo7O QDcMApj6d2mNjU63GT6bdD92Da
  • In the Marketplace tab, click on “Access Keys”
W1i zXiwG7FLx dDLt2ZPAKfl9 wAhfBSxtBPt71WuRr0MBjVbrtQAwDUYdoITczHs3qnL4XBsnCsgIlV1VhEvMoUJlURzp hm4
  • Create a New Access Key if you don’t have Access Keys
  • Enter a name for the keys (e.g., name of developer) and click OK
  • Click to copy your new public and private keys. They are now associated with your account. Save this information or keep the tab open when working with your Magento project. Use your Public key as the username and the Private key as a password
  • Wait until Composer finishes updating your project dependencies and make sure there aren’t any errors
  1. Verify extension

Run the following command to verify that the extension is installed properly

Php bin/magento module:status Mailjet_Mailjet

If the extension is disabled by default, you will see this message.

PM9agUXbDFSZvhaE6O4pZCpVfVIv7NwX3Hlffcjz l5CJ16NA5a0aoL5Bmytvv9rZZr8IL NGMNWlpdevFgKSMW4CjK9JivtXv8SMIUeWpLC
  1. Enable the extension
  • Enable it and clear static view files 
php bin/magento module:enable Mailjet_Mailjet–clear-static-content
  • Register the extension
php bin/magento setup:upgrade
  • Recompile your Magento project: 

You may receive this message in Production mode: “Please rerun Magento compile command”. In Developer mode, Magento does not prompt you to run the compile command. 

php bin/magento setup:di:compile
  • Verify if your extension is enabled or not
php bin/magento module: status Mailjet_Mailjet

If you see this output, your extension is enabled.

Mn6HoBJPt55ZBLtmzmmExBa9jT fJyE5SMv5p0yHoyG3i8Gagd4uY89uXyYATm PvaddGajwQuGtrcqPTBR84OCDEcFLqNsMtRFzMWtXvzRawhB2DY3ZvhK6nlPuyLlj73Qf4aWz MtR4zSdSpWUMAlXHP8f kqzIjyLLIeUb4bYPits6G2ZhoRsmaHK
  • Now, clean the cache.
php bin/magento cache:clean
  • Disable maintenance mode

php bin/magento maintenance:disable

  • In Admin, configure the extension as per your requirement, Admin panel > Stores > Configuration > Mailjet

You will need a Mailjet account to set your API settings, if you don’t have any, click here to create a Mailjet account.

The Mailjet extension has been successfully installed!

The next step is to configure Mailjet Extension and to configure it, return to your Magento Admin Page.

How to Configure Mailjet Settings?

  1. In the Magento 2 Admin Page, navigate to “Mailjet” → “Configuration”.
Uy4xK0l7nwc6V3V67vVntALWX3GoGCYdixCpaVjjytUi4GbPshaEhYCO6iHMzPPoxJN8gxGqabfZmLQLKqBVV2kzIdQiKvbV6fQfd2QX gZoqze2ygEmdyjXjYLbX4zvi9Bbj8VHkwGG5v BcyO
  1. You’ll see a Mailjet section in the left side menu; click on “Account Configuration” under the “Mailjet” section
npHpqSdxk3UYo3Ik5mV2xyfppPg 9hebTJStq8FGBBh7IOcl9UgqpgHZo6GeEXL9u1GiDDOEXqepUC8gCG6Jih7Eap
  1. Now enable the plugin and add your Mailjet API key and Secret Key.
KIdsz5NEY 8ZzvPetAubYdPLiE2OiFI RLMBcs4NCMMksHkR6eLOvm8sT9SW13LPUgcQHHA1pWOPM1AReNswcY 7rHbQMQ xUofW8kIxTaFMRnqVqfb Df GngACaGYn3OHWEITdU8S2NRrP1Qr47QfT3bhkhYokpIF5P0aybzZvX8IpzLeC6XAeS7aa

What do these options do?

  • Plugin Enabled– Set it to “Yes”. By doing so, you enable Mailjet to send all emails from your Magento Environment. You can access real-time statistics, order status, ROI on campaigns, and more with Mailjet’s SMTP relay.
  • API settings– Enter your Mailjet API and secret key to link Mailjet with your Magento account. Find your API and Secret Keys on the API Key Management Page
  • Subscribed Sync enabled– “Yes” means Magento 2 subscriber data is synced with Mailjet and vice versa
  • Unsub event enabled – Sync unsubscribed contacts automatically from Mailjet to Magento 2.
  • SMTP enabled – When it’s enabled, Magento 2 transactional emails are delivered through Mailjet SMTP.

Click on “Save Config” once you’ve entered all the information.

UmbJZxtbZBXXlJDwAviNnyro2Qse5tP5craudX6ri 5jTTJ MDNULYtFxnIAP0Zg7SSVcXfvquOQ679579Vf0WA3PsiLZ5OU7fR1sA5O9gO7S4W MXKSiSizOFqurk1BYnzsW4PSJra2kRQo2i4

How to configure the sender address for automatic emails?

To choose the sender address, choose General under the configuration section and navigate to “Store Email Addresses”.

rbbeNbREnX0l91b2hRh5bHQFhv2P 1qbxxBnIJAI lWLsjImlzPJElJhZo1v1HHzvMkB2pJDRMRg04443yB PusbXuiFZYokF4086ymSHBLTPZcM0VCvoYh4nE9v3 g98zBEiKig8r6abiUG8mFX0mS8WZHK0ti07uRzfE 0AuIL5 EXw0ZMqSySJFgJ

You can select the email and sender name from the options available in this section.

PpHMfqhOFEp7ldemAWs7biFwcjKno6BF0GCrr8QoyCppvXwcIRorOzaKeNZ6RSnug1rtoiBpWBxix3Pj NlG1Hcg dWS3a1iI3ItvB65mXY1b6CZswvNsPqobjK5RUuluGLO9IrfBg474hW74 rDs

You will have to verify the General Contact email in Mailjet in order to use it. General Contact email will be used by Magento to send automatic emails.

Please visit the Sendor Domains & addresses section of your Mailjet account to verify the General Contact email.

How to track events?

If you want to track events automatically in Magento, use the Endpoint URL displayed at the top of the Mailjet “ Settings” Section.

g3EZQWQAXAoJQ59yrq MMMQjsCgMtsUo7r9HSFoOrN9rCrrqmVNDUUK5V8NwKaHVxDAfZKe487ZeDrG2ScI27ZVlAURqtn2Ja6v5 rpIdXIiYacj NAPqN49Db7PozSfaRZLRSRIEEoD4zJEW0Q2wWokPV5dBtwFuTnPUPHdiJcl6cL7IsYedK5e3Q40

First copy the displayed link, then navigate to the “Event Tracking” section in your Mailjet account.

pPUtGnOfWgXrwiQ7nwgTPW1ME9UX1iEhdsTHjrraJ5BuuKlcZy1izID8j9z4wRwgcAJeuGXX9EGBWgkjK EyRjp5f4QOB4zmjqeLYK7RJsQ97CjtJ0VQldMntbjGuvEr1asUG6ibpz4WACOCnWGL3mWplcKCfE4 RRr10zIwMkXWcnKy4LQ0smHv7KIiLet’s take the example of the “unsub” event here. When a customer unsubscribes from your newsletter, the information will be pushed to Magento, and the customer’s profile will be updated automatically. 

Simply follow these steps to automate the whole process.

  1. Tick the checkbox; in our case, tick the checkbox next to “Unsub”.
  2. Paste the Endpoint URL
  3. Click on “Send” to test the URL.
  4. You will see a message OK, Code 200 if the test is successful
  5. Click “Save” 

That’s it. You have configured your Mailjet Extension!

Now, you can automate emails on your Magento store.

Industry news straight to your inbox

Get the latest commerce news, trends, and strategies to grow your business
Subscribe to the newsletter
By submitting this form, you agree to receive promotional messages from Magstack. Unsubscribe any time by clicking the link in our emails.
Select location and language

Contact Our Sales Team

Learn more about our products, features, and pricing options.
By submitting this form, you agree to receive promotional messages from Shopify about its products and services. You can unsubscribe at any time by clicking on the link at the bottom of our emails.
Use cases
Log in
Start a free trial