Review: Process to get orders from external system into Mautic

Good morning,

I’m new to Mautic and have been tasked to run campaigns as reactions to sales in an online shop. After reading through the Mautic docs, I’ve settled on the following approach:

  • Writing a custom Plugin which offers a CLI command, which periodically calls the online shop and fetches the newest orders.
  • The plugin creates or updates the clients (I’m not using integration sync due to the peculiarities of the online shop API: I can only fetch customers and orders at the same time, afterwards the disappear.)
  • The plugin adds a point to a contact for the order and adds the total amount of the order to the contacts attribution.
  • The order itself is then added to Mautic in the plugin as a simulated form submission (Campaign form) with all the details stored. Some additional form fields are calculated in the plugin and stored in the form as well. Additionally the order summary is added as a note to the contact.
  • The form submission itself triggers a campaign which will then send out mails depending on conditions on these special form fields. The campaign can be restarted by contacts in future orders.

Is that a sensible approach?

Thank you,
Christian

Oh, by the way: The developer experience with DDEV is great! Thank you so much.

Hey @cstuder

That sounds like a very solid approach.
A few things and questions:

  1. What version of Mautic are you running ?
  2. Have you considered using Custom Objects to store orders, this will allow for you to store not just the last order, but every order a customer makes, which can lead to great insights and marketing vaue in creating RFM models.
  3. What is the online store running - wordpress/shopify/react/custom ?

The only other thing is

The order itself is then added to Mautic in the plugin as a simulated form submission (Campaign form) with all the details stored. Some additional form fields are calculated in the plugin and stored in the form as well. Additionally the order summary is added as a note to the contact

Not sure why you would do this, might consider passing the orders through with a tag, or using dynamic segments to populate based on whatever criteria you want.

1 Like

Thanks for your reply.

  1. It is a fresh Mautic 5.2 install.

  2. I’m not familiar with custom objects, I’ll look it into it. I assume it’s the Acquia plugin here. My plugin currently stores orders as general contact notes, so the order history can at least be seen manually.

  3. The online store is running a proprietary ticket sales system, nothing well known or open sourced. I just have the one API endpoint to get the last orders, nothing more.

  4. Ah, tagging the submissions might be a viable way to go too. Why I’m doing this: The client requests that for tickets valid on the current day a mail with additional informations is sent out immediately, But for tickets valid on future days, a slightly different mail is sent out the day before. That’s why I’m calculating the “days until arrival” in my plugin and then use that number as a condition in my campaign workflow.

Thank you for your feedback, it’s good to know that I’m not entirely off track.

With regards,
Christian

Yes, that is the plugin, i have not checked it with 5.x as of yet so not sure how nicely it plays.
We run all clients on 4.4.13 as this to my knowledge is the most stable version at the moment. We have yet to migrate customers over to 5.x, however are in testing mode.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.