In order to automatically generate texts from IC Robotics in Magento2, you will need to set up a webhook in Magento2.
You will have to go through 3 steps to automate the text generation for Magento2.
1. Install a webhook module in Magento2
Install a webhook module (E.g. https://github.com/mageplaza/magento-2-webhook, which is free and can be installed with or without "Marketing Automation", but both should work)
✋🏼 NOTE: If you are choosing the one recommended above, the following is important:
After installation, go to 'Store > Settings > Configuration > Mageplaza Extensions > Webhook' and write an e-mail address in 'Send To' under 'General'
If not, all product updates from the admin panel will fail.
For more information visit: https://docs.mageplaza.com/webhook/index.html#i-configuration)
2. Create a Webhook URL in IC Robotics
First, you will need to publish your template - see how here.
Once you have you have published your template you get a publication on your template.
- Click on the Three dots and then Webhook’.
- Generate a webhook URL by adding an IC Robotics' API key or generate a new API key.
- Copy the URL, which you will need to paste into Magento2.
Want texts on All Store Views?
You are now able to click the check mark under template settings for your template to push text to all your store at once.
3. Create a new Webhook in Magento2
- Go to ’System > Webhook > Manage Hooks’.
- Click on the downwards pointing triangle new to the button ’Add New’.
- Choose ’New Product’ or ’Update Product’.
- On the first page (’General’) you will have to give a name for the Webhook and choose Store Views that need to send a Webhook
- We recommend choosing ’All Store Views’, to make sure that webhooks are sent - we only get data and push texts to the store views chosen on the Template Settings in IC Robotics ... unless you have chosen to Update all storeviews, as shown in the green box above.
- On the next page (’Actions’) you will need to paste the webhook URL from step 2 in the field called Payload URL.
- In the Method you will have to choose POST. Authentication should NOT be sat, as we use an API key directly in the URL.
- In Content-type choose application/json.
- Lastly, the Body should be filled out with the following JSON formatted message:
{
"sku": "{{item.sku}}"
}
✋🏼 Note:
Make sure to use standard quotation marks (") and not ’smart’ quotation marks (‘‘ ’’) - Some computers might change them automatically.
The variable, which is set as the value ( {{ item.sku }} ), needs to be the product's SKU, and can be chosen by clicking ’Insert Variable’.
You are now ready to go! 🎉
👉🏼 For more information visit: https://docs.mageplaza.com/webhook/index.html#ii-manage-hook)
Do you not want to update all texts?
You can exclude some texts from getting texts, if you have chosen Manual or Semi under Auto update fields in your Template Settings.
If so, you will need to include the variable for "ic_include" (Manual) "ic_exclude" (Semi) in the message and link it up with a true/false variable in Magento2 - for example:
{
"sku": "{{item.sku}}",
"ic_include": "{{item.should_update}}"
}