2

When a Sales Order is emailed to a customer with Email Preference set to PDF, the body of the email reads:

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]

I'd like to add onto this message a bit. I think that will require me to write a script that renders the transaction to a PDF template and sends the email with whatever message I choose. It also needs to prevent NetSuite from sending the default email as well.

Would the following work:

In a beforeSubmit function on Sales Order records, if the customer has Email Preference=PDF, uncheck the 'Email To' field. Set a new custom checkbox such as 'Email PDF' to true instead.

In a User Event Script, after a Sales Order submits and has 'Email PDF' set to true, render the transaction to a PDF and send it in an email to all the 'Email To' recipients.

Or is there a better solution I may be overlooking?

The 'duplicate question' says this can't be done yet I have a working solution. It also references SuiteTalk, not the same.

Badger
  • 301
  • 3
  • 15
  • Possible duplicate of [Netsuite suitetalk transaction email with pdf attachment intro text](https://stackoverflow.com/questions/38237437/netsuite-suitetalk-transaction-email-with-pdf-attachment-intro-text) – Jdg50 Jan 03 '19 at 12:48
  • There's no answer there so that doesn't really help. – Badger Jan 03 '19 at 23:09

1 Answers1

3

This is a solution someone gave me on the official NetSuite forum:

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
Badger
  • 301
  • 3
  • 15