I would like to add data from the recipient-schema to each SMS-delivery, without using a personalization-block in the message GUI. The added data should not be a part of the text message, it will be used for logging purposes. The only workaround I found is adding it as a personalization block and then remove it in the smsConnector script. The reason I don't want to do like that is it could be deleted by the user and would probably effect the length validation of the message.
This is what the data (input parameter to the function processDeliveryPart) looks like in the smsConnector-script (when adding lastName as a personalization block):
<deliveryPart IPAffinity="" contentModTime="" delivery-id="" hostname="" id="" lang="" mobileConnector="1" mobileType="0" nextPass="" processId="" rcpCount="" retry="" startDate="" validityDate=""> <message address="" id="" recipient-id="" released="" sourceAddress="" targetCode=""> <custom> <recipient lastName=""/> </custom> <text></text> <source></source> </message> <delivery/> <options appType="" class="" codepage="" extAccountId="" forceCodepage="" maxSmsPerMessage="" mbloxServiceId="" priority="" serviceType=""/> <login account="" password="" port="" server=""> <params defaultMoCharset="" defaultMtCharset="" deliverIdEncode="" submitRespIdEncode=""> <oauthParams thirdPartyApplication=""/> <facebookParams marketingURL="" realtimeSubStatus=""/> <mscrm crmDeploymentType="" crmVersion="''"/> <salesforce apiVersion="''"/> </params> </login> </deliveryPart>
Ideally I would like to modify the message-tag, and add an attribute there.
Solved! Go to Solution.
Hi Jon and thanks for your advice,
This is the first time I am working with js-typologies. Do you know what kind of objects that are available in the context (apart from delivery)?
Is the recipient-data-table available in this context (so I can just refer to recipient.[columnName])? The optimal solution would be to get the data at the same time I get the other recipient-data in the workflow (to avoid unnecessary DB calls).
Hi and thanks again. Ended up with a dirty workaround, appending the data to the actual textmessage (with a typology rule: delivery.content.sms.source += ':!:!<%= recipient.xxx %>') and then removed it in the smsConnector-script. Didn't find any way to add a separate variable that were accessible from the connector script..
@wodnicki Do you know if there is any way to modify the object coming to the connectorScript as input parameter? (the xmlDeliveryPart in above xml). The script is referenced in the external account used by the delivery, in the connector tab. I would like to add an attribute to the delivery-tag as well, since this information is not unique for each message. Or is it possible to append this kind of data in a typology rule?
Hi again, I would really like to find a better solution then the one I am using now. I am currently adding the data to the message it self (delivery.content.sms.source+="exampledata") with a typology rule. I would like to put this data in another variable. How do I know which variables which are available both in typology-rule context and in the xmlDeliveryPart-object, in the connector-script? Where is the mapping made? Could I make my own variable in the typologyrule and use it in the connector-script? @wodnicki
Okay, so I have added the information to a custom code-field like this: delivery.content.sms.code
Where do I find the mapping between delivery content and the deliveryPart object in the smsConnector-js-script? @wodnicki