我正在使用 N/email 模块发送一封我想附加到多个交易的电子邮件。通过使用以下代码的单个事务,我没有问题:
email.send({
author: -5,
recipients: recipient,
subject: subject,
body: body,
relatedRecords: {
transactionId: 8
}
});
但是,文档确实暗示,当它说 transactionId 应该是时,我们可以关联多个事务
与消息记录关联的事务记录。
但是,以下示例均无效。所有这些电子邮件都正确发送,但它没有附加到任何一个交易中。我有点不知所措。
// Example 1
email.send({
author: -5,
recipients: recipient,
subject: subject,
body: body,
relatedRecords: { transactionId: [8,10] }
});
// Example 2
email.send({
author: -5,
recipients: recipient,
subject: subject,
body: body,
relatedRecords: [{ transactionId: 8 }, { transactionId: 10 }]
});
// Example 3
email.send({
author: -5,
recipients: recipient,
subject: subject,
body: body,
relatedRecords: { transactionId: '8,10' }
});
这应该如何实现?