Magento 2

Magento 2

Introduction

The module synchronizes customer data, order data and shopping cart information between Magento and Maileon. Magento is the primary system, which means that the customer information in Magento is considered the main information and changes to that data are synchronized with Magento. Conversely, only certain information is synchronized: the DOI confirmation and unsubscription. For order details and cart abandonments, this information is sent to Maileon as transactions (events) and can be used either to analyze data using contact filters or to activate a trigger mailing. All functions can be set via a configuration panel in Magento.

Installation

Install via Composer

The module can be installed using Composer with the following command:

composer require xqueue/module-maileon

Install via ZIP package

Below version 1.0.8

The first step is to copy the Maileon directory into the /app/code directory of the Magento installation. If the app directory doesn't already contain a code subdirectory please create it. After this the module must be enabled using the following steps:

From version 1.8.1

Copy the Maileon plugin to the Magento root folder (/sources/magento-2/Xqueue/Maileon/). Add the following line to the Magento composer.json:

"require": { "xqueue/module-maileon": "^1.8" }, "repositories": [ { "type": "composer", "url": "https://repo.magento.com/" }, { "name": "xqueue/module-maileon", "type": "path", "url": "sources/magento-2/Xqueue/Maileon" } ],

Run composer update at command line

Enable the module

Before enable the module, we must check to make sure Magento has recognize our module or not by enter the following at the command line:

php bin/magento module:status

If you follow above step, you will see this in the result:

List of disabled modules: Xqueue_Maileon

This means the module has recognized by the system but it is still disabled. Run this command to enable it:

php bin/magento module:enable Xqueue_Maileon

If the above succeeded the following message is displayed:

The following modules has been enabled: Xqueue_Maileon

This’s the first time you enable this module so Magento require to check and upgrade module database. We need to run this command:

php bin/magento setup:upgrade

If everything went well you can switch to Magento’s admin interface. The plugin settings are available in the following menu:

Stores -> Configuration -> Maileon

Configuration in Magento

 

The configuration can be found under “Stores” “Configuration” and, since version 1.8, can be set on Storeview level. This means, that for each Storeview, you can select an own API key, to use different Maileon accounts or you can select different DOI mail keys to send out DOIs in e.g. different languages.

magento-maileon-config.png
Figure 1: Maileon Extension Settings

General Settings

 

magento-general-config.png
Figure 2: General settings

 

  • Maileon Api Key: The API key associated with the Maileon account you wish to use. At Maileon Settings → API Keys.

Subscriber Settings

magento-nl-settings-config.png
Figure 3: Subscriber settings

 

  • Enable: This enables the newsletter subscriber module. This module synchronizes new subscriptions to Maileon.

  • Initial Permission: The initial permission level to set for new Maileon subscribers.

    • None: No permission. The contact will not receive newsletters.

    • Single Opt-in: Permission was simply granted, e.g. by entering an email address in a form. This method technically allows the contact to receive newsletters, but does not ensure that the email address belongs to the person who entered it.

    • Confirmed Opt-in: A confirmation mail about the registration is sent to the provided email address, but it does not contain a confirmation link. This method is frequently abused by spammers. The recipient will have to actively revoke consent in order not to receive any advertising emails.

    • Double Opt-in: With this permission, a confirmation email with a confirmation link is sent to the email address. Only when the link in the mail has been clicked and thus the interest in the entry has been confirmed, the contact can be sent.

    • Double Opt-in Plus: Double opt-in including consent for single user tracking.
      Please note: Without individual user tracking, no openings, clicks, etc. may be traced back to individual users and significant data for evaluating newsletter performance is missing.

  • Double Opt-in Process: A confirmation email including a “confirmation link” is sent to the provided email address. The subscription will not be valid until the recipient clicks this link. Thus it is ensured that the recipient is identical to the mailbox owner and really wishes to receive your emailings (the recipient cannot click the confirmation link without having signed in to her or his mailbox). Double Opt-in is the only subscription method we can recommend. Please note that XQ can only provide general information but no official legal counselling. Please contact your lawyer in the case of legal questions on this topic.

  • Double Opt-In Plus (DOI+): Requires option “DOI Process”. A DOI+ permission will be registered after the user clicks the DOI confirmation link in the DOI mail.

Please note: You can only obtain significant response analyses and react appropriately when your contacts have given consent to single user tracking. Taking into account that only the double-opt-in procedure is legally safe (for German-based providers), the only permission method we can recommend is “Double Opt-in including consent to single user tracking”.

  • DOI Mailing ID: If the permission above is set to DOI or DOI-Plus the newsletter subscriber will be sent a confirmation mailing using Maileon. This field can be used to customize which DOI mailing will be sent from Maileon. Leaving it empty means that the default DOI confirmation will be sent. (A default DOI confirmation mailing must be set in Maileon in order for this to work.)

  • Unsubscribe Webhook Token: This token is used to synchronize Maileon unsubscribers back to Magento. This field must be a unique string. (Think of it as a password.) The webhook setup will be detailed later.

  • DOI Confirmation Webhook Token: This token is used to synchronize Maileon DOI confirmations back to Magento. If set the Magento subscriber state will match the Maileon subscription state of each customer. This field must be a unique string. (Think of it as a password.) The webhook setup will be detailed later.

  • Unsubscribe All Matching Emails: Since Magento 2.4, the same email address can be subscribed multiple times across different store views. In Maileon, contacts may belong to different newsletter accounts per store view, so Magento needs the store view ID to unsubscribe a specific contact correctly.
    If the storeview_id is missing:

    • Yes: all Maileon contacts with the matching email will be unsubscribed.

    • No: the unsubscription will be ignored. It is recommended to configure proper store view ID passing and/or enable this option.

  • Disable Newsletter Confirmation Request Email: Disable Magento's built-in newsletter confirmation request email for newsletter subscriptions.

  • Disable Newsletter Subscription Success Email: Disable Magento's default newsletter subscription success email sent after newsletter subscription confirmation.

  • Disable Ensubscription Email: Disable Magento's default email sent when a customer unsubscribes from the newsletter.

Order Confirmation Settings

magento-order-confirmation-config.png
Figure 4: Order Confirmation Settings

 

  • Enabled: This enables the order confirmation module. This module synchronizes order events to Maileon. Each order creates two types of contact event: magento_orders_v2 and magento_orders_extended_v2. The contact event magento_orders_v2 contains one event for each order. The contact event magento_orders_extended_v2 contains one event per line item in the order.

  • Disable Order Confirmation Email: Disable Magento's default order confirmation email sent after a successful checkout.

  • Enable Separate Permission For Buyers: Enable a separate permission level for customers who complete a purchase, if this setting is enabled, customers who do not yet exist in Maileon and have not unsubscribed will be created with the permission set below. They will be granted instant permission even if the permission are DOI or DOI+

  • Buyers Permission: If the above option is enabled, you can set the permission here

 

After version 1.9 you do not need to disable Magento order confirmation emails in the settings. (Configuration/Sales/Sales Emails → Order)

Contact event type magento_orders_v2

Field name

Type

Description

Field name

Type

Description

order.id

string

Order id (incremental id)

order.date

timestamp

Order timestamp

order.status

string

Order status

order.total

float

Order grand total

order.total_tax

float

Order tax amount

order.total_no_shipping

float

Order total without shipping cost

order.currency

string

Order currency

shipping.service.name

string

Shipping method

payment.method.id

string

Payment id

payment.method.name

string

Payment name

order.items

JSON

Ordered items in json

shipping.address.firstname

string

Shipping address first name

shipping.address.lastname

string

Shipping address last name

shipping.address.phone

string

Shipping address phone

shipping.address.region

string

Shipping address region

shipping.address.city

string

Shipping address city

shipping.address.zip

string

Shipping address zip

shipping.address.street

string

Shipping address street

billing.address.firstname

string

Billing address first name

billing.address.lastname

string

Billing address last name

billing.address.phone

string

Billing address phone

billing.address.region

string

Billing address region

billing.address.city

string

Billing address city

billing.address.zip

string

Billing address zip

billing.address.street

string

Billing address street

generic.string_1

string

Store ID

generic.string_2

string

Store name

Contact event type magento_orders_v2 order.items

Field name

Type

Description

Field name

Type

Description

product_id

string

Product id

title

string

Product title

single_price

float

Product single price

total

float

Item total price

sku

string

Product sku

quantity

integer

Item quantity

url

string

Product url

image_url

string

Product image url

categories

string

Product categories list separated with ,

short_description

string

Product short description

Contact event type magento_orders_extended_v2

Field name

Type

Description

Field name

Type

Description

order.id

string

Order id (incremental id)

order.date

timestamp

Order timestamp

order.status

string

Order status

order.total

float

Order grand total

order.total_tax

float

Order tax amount

order.total_no_shipping

float

Order total without shipping cost

order.currency

string

Order currency

shipping.service.name

string

Shipping method

payment.method.id

string

Payment id

payment.method.name

string

Payment name

product.id

string

Product id

product.title

string

Product title

product.single_price

float

Product single price

product.total

float

Item total price

product.sku

string

Product sku

product.quantity

integer

Item quantity

product.image_url

string

Product image url

product.url

string

Product url

product.categories

string

Product categories list separated with ,

product.short_description

string

Product short description

shipping.address.firstname

string

Shipping address first name

shipping.address.lastname

string

Shipping address last name

shipping.address.phone

string

Shipping address phone

shipping.address.region

string

Shipping address region

shipping.address.city

string

Shipping address city

shipping.address.zip

string

Shipping address zip

shipping.address.street

string

Shipping address street

billing.address.firstname

string

Billing address first name

billing.address.lastname

string

Billing address last name

billing.address.phone

string

Billing address phone

billing.address.region

string

Billing address region

billing.address.city

string

Billing address city

billing.address.zip

string

Billing address zip

billing.address.street

string

Billing address street

generic.string_1

string

Store ID

generic.string_2

string

Store name

Customer Related Email Notification settings

Screenshot 2025-10-22 at 10.37.36.png
Figure 5: Customer Related email Notifications