使用Customer.io如何同时向两个不同的用户同时发送2个不同的电子邮件。
问题描述:
正如标题所述,我想发送两个不同的电子邮件,同时发送给两个不同的用户。 我正在使用JavaScript作为API。使用Customer.io如何同时向两个不同的用户同时发送2个不同的电子邮件。
我也想知道如何在自定义日期发送延迟电子邮件。目前我们可以通过仪表板完成这项工作,但可以修复日/星期。但我正在寻找的是计算日期并添加一个自定义日期延迟,不能按照仪表板中给定的那样进行预定义。
谢谢。
答
那么问题就解决了。 我为每个客户创建了两个独立的API调用。使用switch语句和while循环
switch(customer){
while(counter > 0){
case 1:
//Make first API call
//_cio.identify
_cio.identify({
// Required attributes
id: id, // Unique id for the currently signed in user in your application.
email: yourEmail, // Email of the currently signed in user.
created_at: time, // Timestamp in your system that represents when
// the user first signed up. You'll want to send it
// as seconds since the epoch.
// Optional (these are examples. You can name attributes what you wish)
task: task,
supervisor_email: supervisorEmail, // Add any attributes you'd like to use in the email subject or body.
goal_date: date, // To use the example segments, set this to 'free' or 'premium'.
user_name: name,
supervisor_name: supervisorName,
goal_setter: isUser,
pay: pay
});
customer = 2;
break;
case 2:
//Make the second API call
break;
counter--;
}
}