To modify the email body for Sales Orders sent as PDF attachments in NetSuite, you can follow these steps:
1. Create a script: Begin by writing a script that includes a beforeSubmit function for Sales Order records.
In this function, check if the customer's Email Preference is set to PDF. If it is, uncheck the 'Email To' field and set a new custom checkbox, such as 'Email PDF', to true.
2. Implement a User Event Script: After a Sales Order is submitted and the 'Email PDF' checkbox is set to true, create a User Event Script.
In this script, utilize the render function to generate a PDF version of the transaction. Then, send this PDF as an email to all the recipients listed in the 'Email To' field.
By following these steps, you will be able to customize the email body for Sales Orders sent with PDF attachments in NetSuite.
This solution will also prevent NetSuite from sending the default email message.