Subscriber Fields Trigger (Advanced Trigger)

Last Updated: 28/11/2024     Tags: trigger, triggers, advanced, js, javascript
  • Switch Version
  • V5
  • V4

Any subscriber fields, custom fields, and list subscriptions can be updated during execution of a trigger.

st=>start: Event e=>end: End op1=>operation: Update Subscriber Record st(right)->op1(right)->e

JS Code

The tm.api method provides access to the full range of Taguchi APIv4 functionality, and can be used as follows:

var tm = require('tm');

exports.handler = function (event){
    tm.api('subscriber', 'update', {
        record_id: event.subscriber.id,
        data: {
            custom: {
                sampleField: "some sample data"
            }
        }
    });
}

Reference

For more information about advanced triggers, see the Advanced Trigger Reference.