如何通过节点 js api 将自定义参数传递给 sendy?

How to pass custom parameters to sendy via node js api?

我正在尝试通过 sendy 的 api 在 sendy 中传递自定义数据。 Sendy 有自定义字段属性,我们可以在其中传递数据。我正在使用 sendy 节点 js 包,其 link 在 sendy 网站上提供。问题是我无法将自定义字段数据传递给 sendy api。这是我的代码

 var params = {
            email: email2,
            custom: {
                'assignmentDetail':assignmentLink,
                'submissionDetail':submissionDetail,
                'FormLink':reviewerFormLink,
            },
            list_id: ListID,
            api_key: 'vQzxtX76pNFekG4w5BzC'
        };
        sendy.subscribe(params, function (err, result) {  if (err){ 
                console.log(err.toString());
                }else{ 
                UpdateData(recordID, email2, ListID);     
                console.log('Subscribed succesfully');}
            });

自定义字段数据未在 sendy 中传递。请帮助

我找到了解决问题的方法。这很简单。您需要将自定义字段用引号括起来,然后就完成了。就这样

 var params = {
            email: email2,
         //make sure custom field names are same otherwise sendy would igore the fields
                'assignmentDetail':assignmentLink,
                'submissionDetail':submissionDetail,
                'FormLink':reviewerFormLink,
            
            list_id: ListID,
            api_key: 'vQzxtX76pNFekG4w5BzC'
        };
        sendy.subscribe(params, function (err, result) {  if (err){ 
                console.log(err.toString());
                }else{ 
                UpdateData(recordID, email2, ListID);     
                console.log('Subscribed succesfully');}
            });