Expand my Community achievements bar.

SOLVED

Map mobilePhone field to custom channel during delivery execution

Avatar

Level 4

Hi Team,

 

We have a custom whatsApp channel created as a separate messageType(whatsApp) in nms:delivery extension schema, we have also created the external account with the new messageType(whatsApp) and configured the JS connector as well. we are not sure how to map mobilePhone filed form nms:recipents to the new whatsApp connector during delivery execution. currently the delivery when executed with the new connector has the address column empty in the delivery logs. 

 

whereas when we add the same custom JavaScript connector to an SMS External account, we are able to execute and receive whatsApp messages.

 

Can someone help us on how to map mobilePhone field for custom channel. thanks much in advance.

 

Thanks,

Shine v.v

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @ShineVv0823

 

You have to extend nms:deliveryMapping schema to add a new attribute named "whatsApp" (same name as the new message type). add it also in the deliveryMapping form. and then map in it the recipient attribute you want to use on your connector (mobilePhone i believe).

 

Br,

Amine 

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @ShineVv0823 ,

 

Could you Please try mapping the mobile phone number field to the Agency Identifier field in the Target Mapping and try sending the delivery.

 

LakshmiPravallika_1-1697124568847.png

 

If this don't work, it can be tried by adding it in the Additional Data of Target Mapping, the required field to be populated

LakshmiPravallika_2-1697124754106.png

 

 

Also, could you Please share us the Custom JavaScript code used for this WhatsApp connector?

 

If any error code received  for this issue, could you Please share us the Info?

 

Regards,

Pravallika.

Avatar

Level 4

Hi @LakshmiPravallika ,

 

Thank you for your help. 

 

Tried with the first approach (mobile phone number field to the Agency Identifier field), we had the same issue the new channel delivery is not picking up the address field as mobilePhone.

 

ShineVv0823_1-1697173318875.png

 

 

The second approach we added the additional field in the target mapping, but all channel deliveries are failing with the below error. not sure if we have missed out on something and so we removed the field in the target mapping.

 

ShineVv0823_0-1697173173268.png

 

The whatsApp connector JS is working fine we choose the external account as SMS and choose the connector JS as whatsApp connector. we are able to send and recieve whatsApp messages.

 

in this scenario we are creating a new channel by creating as a separate messageType(whatsApp) in nms:delivery extension schema

 

<enumeration basetype="byte" default="mail" label="Channel" name="messageType">

<value desc="WhatsApp" img="nsx:whatsApp.png" label="WhatsApp" name="whatsApp"
value="50"/>

 

</enumeration>

which creates a new channel in the external account.

 

ShineVv0823_2-1697173547194.png

 

 

Thanks,

Shine v.v

 

Avatar

Level 4

Hi @LakshmiPravallika ,

 

the detailed error logs and target mapping screenshot is below

 

13/10/2023 09:54:48 XSV-350122 An error occurred and the process has been stopped.
13/10/2023 09:54:48 SOP-330011 Error while executing the method 'PrepareMessageImpl' of service 'nms:delivery'.
13/10/2023 09:54:48 (0, 127)' could not be executed.
13/10/2023 09:54:48 WDB-200001 SQL statement 'INSERT INTO NmsBroadLogRcp (iBroadLogId, iDeliveryId, sAddress, iStatus, iFlags, tsEvent, tsLastModified, iMsgId, sAddress,iRecipientId) SELECT BL.iMessageId, 587651, BL.sAddress, CASE WHEN BL.iFailureReason = 0 THEN 6 ELSE 0 END, CASE WHEN BL.iFailureReason = 127 THEN 8 WHEN BL.sTargetCode = E'__MAIN__' THEN 0 WHEN BL.sTargetCode = E'__BAT__' THEN 2 ELSE 4 END, GetDate(), GetDate(), BL.iMsgId, BL.sAddress,BL.iRecipientId FROM wkDlv_587651 BL WHERE BL.iFailureReason IN
13/10/2023 09:54:48 PGS-220000 PostgreSQL error: ERROR: column "saddress" specified more than once LINE 1: ...iStatus, iFlags, tsEvent, tsLastModified, iMsgId, sAddress,i...

 

 

ShineVv0823_0-1697178491657.png

 

Thanks for your help.

 

Regards,

Shine v.v

 

Avatar

Correct answer by
Community Advisor

Hello @ShineVv0823

 

You have to extend nms:deliveryMapping schema to add a new attribute named "whatsApp" (same name as the new message type). add it also in the deliveryMapping form. and then map in it the recipient attribute you want to use on your connector (mobilePhone i believe).

 

Br,

Amine 

Avatar

Administrator

Hi @ShineVv0823,

Was the given solution by @Amine_Abedour helpful to resolve your query or do you still need more help here? Do let us know.

Thanks!



Sukrity Wadhwa