更改以PDF附件形式发送的交易的电子邮件正文

时间:2019-01-02 23:29:59

标签: netsuite suitescript2.0

将电子邮件首选项设置为PDF的销售订单通过电子邮件发送给客户时,电子邮件的正文为:

Please open the attached file to view your Sales Order.

To view the attachment, you first need the free Adobe Acrobat Reader. If you don't have it yet, visit Adobe's Web site http://www.adobe.com/products/acrobat/readstep.html to download it.[/CODE]

我想在此消息上添加一点。我认为这将需要我编写一个脚本,将交易呈现为PDF模板,并随我选择的消息一起发送电子邮件。它还需要防止NetSuite也发送默认电子邮件。

会做以下工作:

在销售订单记录的beforeSubmit功能中,如果客户的电子邮件首选项为PDF,请取消选中“电子邮件至”字段。将新的自定义复选框(例如“电子邮件PDF”)设置为true。

在用户事件脚本中,在提交销售订单并将“电子邮件PDF”设置为true之后,将交易呈现为PDF并将其通过电子邮件发送给所有“电子邮件至”收件人。

还是我可能会忽略一个更好的解决方案?

“重复的问题”说,这还不能完成,但是我有一个可行的解决方案。它还引用了SuiteTalk,而不是相同。

1 个答案:

答案 0 :(得分:2)

这是有人在NetSuite官方论坛上给我的解决方案:

You can accomplish this fairly easily with a Workflow.

- Trigger on Before Record Submit when 'To Be E-mailed' = T
- Set Field Value of 'To Be E-mailed' = F
- Transition to next state After Record Submit
- Use 'Send Email' action. This allows you to use an email template and
  also automatically attach pdf