Map mobilePhone field to custom channel during delivery execution | Adobe Higher Education
Skip to main content
Level 4
October 12, 2023
Répondu

Map mobilePhone field to custom channel during delivery execution

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

Ce sujet a été fermé aux réponses.
Meilleure réponse par Amine_Abedour

Hello @shinev_

 

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 

2 commentaires

LakshmiPravallika
Community Advisor
Community Advisor
October 12, 2023

Hi @shinev_ ,

 

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

 

 

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

 

 

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.

ShineV_Auteur
Level 4
October 13, 2023

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.

 

 

 

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.

 

 

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.

 

 

 

Thanks,

Shine v.v

 

ShineV_Auteur
Level 4
October 13, 2023

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...

 

 

 

Thanks for your help.

 

Regards,

Shine v.v

 

Amine_Abedour
Community Advisor
Community Advisor
October 13, 2023

Hello @shinev_

 

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 

Amine ABEDOUR
Sukrity_Wadhwa
Community Manager
Community Manager
October 26, 2023

Hi @shinev_,

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