I have an adobe form with several yes/no questions. I would like to create a javascript to send an email (or create a draft) if the client answers "Yes" to any of the questions.
I have the email script:
var cToAddr = "user@email.com"
var cCCAddr = ""
var cBody =
"Please, review this........\n"
+
"\n " +
"\n " +
"\n " +
"\nConfidentiality Notice:\n" +
"\n" +
"The information contained in this transmission may contain privileged and confidential information, including patient information protected by federal and state privacy laws. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution, or duplication of this communication is strictly prohibited. If you have received this transmission in error, please notify the sender immediately at (555) 555-5555; and permanently delete this email and any attachments.\n"
this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: "Review Information", cMsg: cBody});
I have a dialog box script:
// Dialog Definition
var oDlg = {
description: {
name: "Email This Form Now", elements: [ {
type: "view", elements: [
{ name: 'You answered "Yes" to 1 or more questions on this form. Would you like to create an email to user@email.com containing this form?', type: "static_text", },
{ type: "ok_cancel", ok_name: "Yes",
cancel_name: "No, close box"},
]
},]
}
};
// Dialog Activation
app.execDialog(oDlg);
I'm not sure how to put them together to create a email draft (or send an email) when the "Yes" button is clicked.