I have created a (whatsApp)notification alert for the document "Purchase Invoice’.
When I submit the Purchase Invoice, no message is sent to the whatsApp number.
Here is the error log report:
Traceback (most recent call last):
File “apps/twilio_integration/twilio_integration/twilio_integration/doctype/whatsapp_message/whatsapp_message.py”, line 19, in send
response = client.messages.create(**message_dict)
File “env/lib/python3.10/site-packages/twilio/rest/api/v2010/account/message/init.py”, line 89, in create
payload = self._version.create(method=‘POST’, uri=self._uri, data=data, )
File “env/lib/python3.10/site-packages/twilio/base/version.py”, line 204, in create
raise self.exception(method, uri, response, ‘Unable to create record’)
twilio.base.exceptions.TwilioRestException: HTTP 400 error: Unable to create record: The ‘To’ number whatsapp:None is not a valid phone number.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “apps/twilio_integration/twilio_integration/overrides/notification.py”, line 26, in send
File “apps/twilio_integration/twilio_integration/overrides/notification.py”, line 33, in send_whatsapp_msg
File “apps/twilio_integration/twilio_integration/twilio_integration/doctype/whatsapp_message/whatsapp_message.py”, line 51, in send_whatsapp_message
File “apps/twilio_integration/twilio_integration/twilio_integration/doctype/whatsapp_message/whatsapp_message.py”, line 28, in send
frappe.log_error(e, title = _(‘Twilio WhatsApp Message Error’))
TypeError: log_error() got multiple values for argument ‘title’
The field “To whatsApp number” is not taking any value.
Am I missing any field in the notification setting?
Error looks pretty straight forward.
To Phone No is not getting captured.
Maybe you need to tell this notification about which field in your purchase invoice is the recipient phone number.
Most likely you do this from recipient child table below.
I tried the options given in the “Receiver by Document field” and “Receiver by role” fields but the “Phone number” is not getting captured in “To whatsapp number” field. I have provided the contact information in supplier details also.
What should be correct value in “Receiver by Document field” and “Receiver by role” fields so that the phone number can be captured correctly?
Please help me in understanding the correct value for “Receiver by Document field” and “Receiver by role” fields so that the phone number can be captured correctly.
This may need to be fixed in ERPNext.
All fields that are tagged as
Phone in options show up in Receiver By Document Field.
Thanks @Smit_Vora. I’ll file a bug for this.
have you tried without the international dialing code +
I just tried this too and the same error is displayed. The “To” field still showing “None”
For Whatsapp Notification you have to configure Twillio first in ERPNext
My Twilio Whatsapp business account is an approved account.
and Twilio settings are also correctly configured in ERPnext.
You have to select contact no as receiver details, not the owner
owner is the one who creates documents and it’s an email.
I checked as Contact Mobile doesn’t have an Option set Phone That’s why it’s not visible in the Notification Recipients list. Because it’s a Standard Doctype Customize Form will not let you update the option of this field. Go to Property Setter List then add these Details and hit save.
After this it will be visible in Notifcation like this
Now select and Send Message Hope you got it
Thank you very much @nomi-gee . This just worked perfectly.