Hi @ray_3008,
Hope you are doing well. Thanks for writing in!
To include a message with fields in the body of the email using your script, you can add a cMsg parameter to the mailDoc function. Here’s how you can modify your script:
this.mailDoc({
cTo: "Email@Address.com",
cSubject: this.getField("PONumber").valueAsString + " - " + "Completed QIF For JN: " + this.getField("JobNumber").valueAsString + " at " + this.getField("Customer").valueAsString + " " + this.getField("Subdivision").valueAsString,
cMsg: "Hello,\n\nPlease find the completed QIF for the following details:\n\n" +
"PO Number: " + this.getField("PONumber").valueAsString + "\n" +
"Job Number: " + this.getField("JobNumber").valueAsString + "\n" +
"Customer: " + this.getField("Customer").valueAsString + "\n" +
"Subdivision: " + this.getField("Subdivision").valueAsString + "\n\n" +
"Thank you."
});
Explanation:
- cMsg: This parameter is used to set the body of the email.
- String Concatenation: The message is constructed using string concatenation. You can format it as needed, including line breaks (
\n) for readability.
- Field Values: The values from the form fields are incorporated into the message body.
Make sure to replace Email@Address.com with the actual recipient's email address.
Hope this helps.
-Souvik