Magento 2
- 1 Introduction
- 2 Installation
- 3 Configuration in Magento
- 3.1 General Settings
- 3.2 Subscriber Settings
- 3.3 Order Confirmation Settings
- 3.4 Customer Related Email Notification settings
- 3.5 Order Related Email Notification Settings
- 3.5.1 Contact event types magento_order_creditmemo_v1 , magento_order_creditmemo_update_v1
- 3.5.2 Contact event types magento_order_invoice_v1 , magento_order_invoice_update_v1
- 3.5.3 Contact event type magento_order_status_changed_v1
- 3.5.4 Contact event types magento_order_shipment_v1 , magento_order_shipment_update_v1
- 3.5.5 order.items json content
- 3.6 Importing Newsletter Subscribers via CLI
- 3.6.1 Command syntax
- 3.6.2 Available options
- 3.6.3 Example usage
- 3.6.4 Progress indicator
- 3.6.5 Notes
- 3.7 Order History Import via CLI
- 3.7.1 Usage
- 3.7.2 Parameters
- 3.7.3 Behavior
- 3.7.4 Example
- 3.8 Abandoned Cart Settings
- 3.9 Configuring Custom Forms
- 4 Enhancing Transactional Data
- 5 Webhook Settings in Maileon
- 6 Changelog
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-maileonInstall 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:statusIf you follow above step, you will see this in the result:
List of disabled modules:
Xqueue_MaileonThis 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_MaileonIf the above succeeded the following message is displayed:
The following modules has been enabled:
Xqueue_MaileonThis’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:upgradeIf 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.
General Settings
Maileon Api Key: The API key associated with the Maileon account you wish to use. At Maileon Settings → API Keys.
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
Enabled: This enables the order confirmation module. This module synchronizes order events to Maileon. Each order creates two types of contact event:
magento_orders_v2andmagento_orders_extended_v2. The contact eventmagento_orders_v2contains one event for each order. The contact eventmagento_orders_extended_v2contains 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 |
|---|---|---|
| string | Order id (incremental id) |
| timestamp | Order timestamp |
| string | Order status |
| float | Order grand total |
| float | Order tax amount |
| float | Order total without shipping cost |
| string | Order currency |
| string | Shipping method |
| string | Payment id |
| string | Payment name |
| JSON | Ordered items in json |
| string | Shipping address first name |
| string | Shipping address last name |
| string | Shipping address phone |
| string | Shipping address region |
| string | Shipping address city |
| string | Shipping address zip |
| string | Shipping address street |
| string | Billing address first name |
| string | Billing address last name |
| string | Billing address phone |
| string | Billing address region |
| string | Billing address city |
| string | Billing address zip |
| string | Billing address street |
| string | Store ID |
| string | Store name |
Contact event type magento_orders_v2 order.items
Field name | Type | Description |
|---|---|---|
| string | Product id |
| string | Product title |
| float | Product single price |
| float | Item total price |
| string | Product sku |
| integer | Item quantity |
| string | Product url |
| string | Product image url |
| string | Product categories list separated with , |
| string | Product short description |
Contact event type magento_orders_extended_v2
Field name | Type | Description |
|---|---|---|
| string | Order id (incremental id) |
| timestamp | Order timestamp |
| string | Order status |
| float | Order grand total |
| float | Order tax amount |
| float | Order total without shipping cost |
| string | Order currency |
| string | Shipping method |
| string | Payment id |
| string | Payment name |
| string | Product id |
| string | Product title |
| float | Product single price |
| float | Item total price |
| string | Product sku |
| integer | Item quantity |
| string | Product image url |
| string | Product url |
| string | Product categories list separated with , |
| string | Product short description |
| string | Shipping address first name |
| string | Shipping address last name |
| string | Shipping address phone |
| string | Shipping address region |
| string | Shipping address city |
| string | Shipping address zip |
| string | Shipping address street |
| string | Billing address first name |
| string | Billing address last name |
| string | Billing address phone |
| string | Billing address region |
| string | Billing address city |
| string | Billing address zip |
| string | Billing address street |
| string | Store ID |
| string | Store name |
Customer Related Email Notification settings