2

I have created a custom activity built with Node.js that POSTS to a text message service and sends an SMS. The activity works great, the last thing I need to button up is passing personalization data into the HTML Modal.

Basically, I have a text input area that allows the users to input the content they would like to send to the consumer. I need to have the personalization tag populated before posting!

Currently this happens:

Hi %%FirstName%%

I need:

Hi Nate

I have worked with the whole {{Contacts.Attributes.DataExtension.Field}} and it works in my Javascript. Do I need to define it in my HTML for it to pass this personalization data? Any input would help!

Thanks!

  • I would suggest using the TreatAsContent() function in your SMS script. This will evaluate any ampscript code you include in your POST. – David Devoy May 30 '18 at 14:00
  • Thanks David, could you maybe give me an example of how that function would be used? Would it work in Node? Here is how the js evaluates the text area content: $.each(inArguments, function (index, inArgument) { $.each(inArgument, function (key, val) { if (key === 'TextMessage') { $('#text-message-body').val(val); } }); }); – Nate Harris May 30 '18 at 21:19
1

I have figured this out!

{{Contacts.Attributes.DataExtension.Field}} fills in the correct data!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.