Import customers contacts from OFN to newsletter
Last updated
Last updated
These workflows allow to export customers info from OFN and import them into one of these newsletter tools: Mailjet, Sendinblue or Mailchimp.
You can import the templates in N8N, then follow the step-by-step instructions displayed in the workflows:
⚠️ For the Sendinblue node, depending on your language, you will have to change the "attributes" names in the query parameters of node 6 (for instance ). Please also note that these attributes names can be changed by the users. If it's the case, the request will fail (it was the same in Zapier).
Ex of request for EN accounts:
Ex of request for FR accounts:
The workflow can be divided in 2 main parts:
Getting customers info from OFN:
A call is made to the API V1, with the enterprise credentials and the shop ID as query parameter, to get the list of customers and their info.
As the hard limit of returned customers is 200, there is an iteration through the pages (the two "IF" nodes), until all customers are returned.
Importing customers info the newsletter tool:
The process is slightly different for each newsletter tool:
Sendinblue:
The workflow allows to create a list first. In order to achieve this, we need to get the Sendinblue folder ID (Node 1) and then create the contact list in this folder (Node 2). The 2 calls are the following:
Next step is importing customers in the list: As there's no upsert (add or update) request, the workflow first does a GET request to Sendinblue, to get all existing customers.
As there's a hard limit of 500 customers per request, there is an iteration through the items until all customers are returned. There's no concept of "page" but instead there's an "offset", which defines from which item the request will return elements. In our case we loop as following: first iteration with an offset=0, second iteration with an offset = 500, etc.
Then the list of existing customers is compared to the OFN one, based on the emails, and only new contacts are kept.
Finally a call imports all these new customers into the Sendinblue list. Query parameters include the contact email and the "attributes" (⚠️ the attributes names depend on the language - in EN it would be FNAME, LNAME - can be changed by the admin - for instance)
There's a "Split in Batches" node beforehand because Sendinblue would return an error if you send too many customers at once.
Mailjet:
The last node is the import made in Maijet. The whole contact list is passed in one time.
Mailchimp:
Thus the workflow is first getting the contacts list in a specific list in Mailchimp (node 3). Note that when you choose the user Mailchimp credentials, its lists will be displayed - it's useful so we don't have to create a list.
Then the list of existing customers is compared to the OFN one, based on the emails, and only new contacts are kept.
These contacts are added to Mailchimp thanks to node "4. Mailchimp Create". There's a "Split in Batches" node beforehand because Mailchimp sometimes dont like too many request at once.
Workflow Automation
In all 3 workflows there's a "Schedule trigger" node that will play the workflow at the defined frequency.
As there's no N8N Sendinblue node yet, the calls are made manually to with HTTP nodes.
After playing these 2 nodes, the admin can copy the list ID and paste it into Node 3.A. (i tried to automatize this but it's not possible to "save" data between execution in N8N - see ).
The first node allows to create a list in Mailjet. After playing this node, the admin can copy the list ID and paste it into the query URL in Node 4. (i tried to automatize this but it's not possible to "save" data between execution in N8N - see ).
In N8N there's a Mailchimp node, but the "Add/update" action doesn't exist (, please upvote).