# Magento 2

Connect with your customers on Magento across channels such as WhatsApp, SMS, and Email. Deliver personalized marketing, deploy chatbots, track orders, engage in conversational commerce, and more.

### What you can do with the Magento 2 connector:

* **Ingest Customer Data**: Use customer data from Magento 2 to send promotional offers and other updates to your customers on popular channels such as Email, SMS, and WhatsApp.&#x20;
* **Automation:** Use flows to automate different business processes, such as order updates and shipping notifications, using different triggers and actions.&#x20;

### Magento 2 triggers and actions in Flows

Once installed, you'll be able to use the following triggers in Flows:

* **Added to wishlist**: Triggered when a product is added to wishlist.
* **Order placed**: Triggered when an order is created.
* **Order refunded**: Triggered when an order is refunded.
* **Added to cart**: Triggered when a product is added to the cart.
* **Shipment fulfilled**: Triggered when a shipment was fulfilled.
* **Checkout started**: Triggered when a checkout is started.

### Magento 2 data synchronization

{% hint style="info" %}
After installation, under the "Data Sync" tab, you can choose the customer attributes and the frequency you want to be imported from Magento 2 into MessageBird.&#x20;
{% endhint %}

## How to install Magento 2

### What you'll need

* Admin access to Magento 2
* Access to Connectors in the Automate Work section in your MessageBird workspace

### Install the connector

1. Log in to your Magento 2 admin panel.
2. Navigate to **Settings** > **Integrations** > **Add New Integration**.
3. Enter a name for the integration and input your admin password for verification.
4. In the API section, designate the resources you want the integration to access.
5. Click **Save** to store the integration details.
6. Locate your newly created integration and click **Activate**.
7. On the subsequent confirmation page, select **Allow**.
8. Collect the **Consumer Key**, **Consumer Secret**, **Access Token**, and **Access Token Secret** values.
9. Use these credentials to establish the connector within MessageBird.<br>

   <figure><img src="https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2FaERn2lngoOC7zPJDyNPI%2FStudio%20message%20template%20(5).png?alt=media&#x26;token=0d94f693-a9bf-40e4-b043-6fa6c3eecd91" alt=""><figcaption></figcaption></figure>

### Extension installation

#### Step one: Extract the ZIP file locally and inspect the contents

{% file src="<https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2FwLNFQa5QepCGD1aHlzST%2FMessageBird_MagentoConnector.zip?alt=media&token=f9fe3f07-3cea-4693-b8fe-690e1ae14adf>" %}

Using the ZIP file named MessageBird\_Eventer.zip that contains a module called Example. Start by extracting all the files from this ZIP file to your local computer. The extracted folder structure might resemble the following:

```
MessageBird/MagentoEventStream/composer.json
```

#### Step two: Upload the files to the Magento filesystem

Once prepared, you can proceed to upload all files to the Magento root filesystem. Use whichever method you're comfortable with; the primary goal is to transfer the MessageBird folder into the `app/code` directory.

#### Step three: Refresh the Magento cache

Next, you'll need to refresh the Magento cache. This is achievable via the Magento backend. Rather than simply refreshing the cache, we advise using the **Flush Cache** button to ensure the removal of any leftover files.

1. Navigate to **System** > **Cache Management**.
2. For **Mass Actions**, select **Select All**.
3. Choose the **Refresh** option and click **Submit**.<br>

   <figure><img src="https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2FzFXKMVxcSlsAnGaP5EwT%2Funnamed%20(6).png?alt=media&#x26;token=6ef59ebc-b91a-446a-9342-a47427c075ed" alt=""><figcaption></figcaption></figure>

#### Step four: Log out and log back in to the Magento backend

This step is crucial: Log out of the Magento backend. Doing so will end your PHP session.

Once you've logged out, log back in again.\
![](https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2Fc0sNSSLij7r0avUqAdLy%2Funnamed%20\(7\).png?alt=media\&token=64896ca7-de39-4999-80c6-afac429e4470)

{% hint style="success" %}
You've successfully installed the Magento 2 connector!
{% endhint %}

### Next steps

With these steps completed, the installation is finalized. After installation, you can monitor the health status of the connector under the **Health** tab.

* **Data Fetching**: Responsible for gathering data from third-party platforms. It generally requires valid credentials or API keys. If its health is compromised, there could be problems with credentials or permissions.
* **Data Capture**: Manages incoming data and events, mainly through webhooks. A non-healthy status typically indicates difficulties with the connector's webhook setup.
* **Engagements**: Handles the processing and ingestion of data into our platform. An unhealthy state might mean the data isn't in the anticipated format.
* **Verify success response**:<br>

  <figure><img src="https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2Fewz8SyXN0mlsT4Oi7hNV%2FStudio%20message%20template%20(6).png?alt=media&#x26;token=f0aecee4-ffd6-4f17-87b7-550dcd77bf67" alt=""><figcaption></figcaption></figure>

### Use Magento 2

Once you've successfully installed the Magento 2 app, you can incorporate its functionalities in various areas of the platform:

#### **Audiences**

* **Purpose**: Build dynamic audiences using customer data imported from Magento. These audiences can be harnessed for broadcast marketing campaigns or omnichannel marketing journeys.
* **How to access**:
  * Go to **Grow customers** > **All contacts.**
  * Click **Create Audience**. Here, you'll notice Magento 2 variables listed under attributes. The same variables are also accessible under the attributes tab.<br>

    <figure><img src="https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2Fr45ig5MJgJIREHnY5cd0%2FStudio%20message%20template%20(7).png?alt=media&#x26;token=2c0c4847-994b-4379-87b1-fd103b55080d" alt=""><figcaption></figcaption></figure>
  * Use these attributes to segment your contacts and create an audience or list. These audiences and lists can be used to send marketing campaigns.

**Flows**:

* **Purpose**: Incorporate Magento triggers and actions in Flows to automate business processes, such as order updates and shipping notifications.
* **How to access**:
  * Proceed to **Flows** located under **Automate Work**.
  * Initiate a new flow or modify an existing one.
  * For invoking a flow using Magento 2 triggers, set the Trigger to "Connector", the Connector to "Magento 2", and then pick the relevant Magento 2 store (if you have multiple installations).
  * Here, you can opt for any of the various triggers that the Magento 2 connector supports.<br>

    <figure><img src="https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2FSQDt7n9u4crrJ9Iwo5KA%2FStudio%20message%20template%20(8).png?alt=media&#x26;token=b49f315f-74a1-4d1b-8c49-32f85b740629" alt=""><figcaption></figcaption></figure>
  * Additionally, to integrate Magento 2 actions into your flows, select Magento 2 from the "Connector actions" dropdown.<br>

    <figure><img src="https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2FfIZngRFpR6zUW5owFEPn%2FStudio%20message%20template%20(9).png?alt=media&#x26;token=a49b8041-2148-4713-9d03-6b9230e33d8e" alt=""><figcaption></figcaption></figure>

### FAQs

#### I don’t see the Connectors/Automate Work option. What am I missing?

Please verify your Access role under 'Organization Settings'. If it's not present there, contact your admin for assistance.

#### **As a Magento 2 merchant with multiple Magento 2 storefronts, can I connect each one to MessageBird?**

Absolutely! Install the MessageBird app for each storefront as required. After installation, view all the storefronts under 'Your Connectors'. Remember, each installation is unique to one store, so you must install it for each storefront individually.

#### **What should I do if my Data sync displays a "Failed" status?**

Please contact our support team for assistance.

#### **Is it possible to restore a deleted connector?**

No, once you delete a connector, it's irreversible. However, you can always create a new connector to replace the one you deleted.

#### **What should I do if I notice errors in the Health status of my connector?**

It's crucial to address any errors promptly. If you're unable to resolve the connector errors yourself, our dedicated support team is here to help.

#### **What happens with my audiences if my connector becomes defunct or is deleted?**

Your audience will still function but won't receive new updates on contact attributes.

#### **What will happen to my flows if my connector is removed or becomes defunct?**

While the flows will remain intact, they will no longer be influenced by the connector or be able to execute actions via the connector. You would need to manually adjust the flows to use new connector instances.

#### **How can I delete the connector?**

1. Go to **Automate Work** > **Connectors** > Your **Connectors**.
2. Search for **Magento 2**.&#x20;
3. From the results, select the connector you wish to delete and click on **Delete connector** located at the top right corner.
