With the 405 code, you can configure the Business Process so that it will first try to send a message to the client on WhatsApp, and if there is no WhatsApp on the client number, it will send him an SMS.
1. Go to “Settings” → “Automation” → “Business Processes” → ” Deal” → “+ Add Template” on the CRM page.
2. Check the “When added” checkbox under “Autorun”.
3. Go to the “Variables” tab and click “Add Variable”.
4. Fill in the two lines in the expanded window: “Name” and “ID”. You can enter any values in Latin. Leave the variable type as String:
5. Click “OK” and then “Save”.
6. Click on the triangle → “Application Actions” → “[WAZZUP] Send message thru whatsapp”:
7. Press the gear on the created action. The “Action Parameters” window will open:
8. Press the three-dot button next to the “Phone number” line:
9. Select “Phone (text)” in the list that opens, then tap “Insert”:
10. Enter the message you want to send to the client and click “Save”:
When a new deal is created, the Business Process will start. If the recipient does not have WhatsApp on the number, Wazzup will return an error 405 to Bitrix, there will be a note with its description in the Workflow log:
11. Click on the triangle between the action of sending a message to WhatsApp and the “End” → “Other” → “Set variables” button:
12. Click on the cog on the “Set Variables” action:
13. Make sure that the same variable you created is selected in the drop-down menu. Next to this line, click the three dot button:
14. Click the “Additional Results” link in the window that opens → “[WAZZUP] send message thru whatsapp” → double-click “…Response code”:
15. The code in the line with the variable will appear:
16. Click “Save”.
17. Click the triangle below the “Set Variables” → “Constructions” → “Condition” action:
18. Click on any of the branches on the gear on “Condition”:
19. Select “Condition Type” — “Variable Value”, from the drop-down list “Property or Field” — your variable, “Condition” — “equals”, in the “Value” line type “405”. Save.
20. Tap on the triangle below the condition you have configured → ” Application actions” and select your application to send SMS:
21. Press the cog on the created action.
22. Fill in the fields to send an SMS, enter the text of the message and tap “Save”:
23. Save the Business Process by clicking the “Save” button in the lower left corner.
Now when creating a transaction, a WhatsApp message will be sent to the client, and if he doesn’t have WhatsApp on his number, an SMS will be sent: