Skip to main content
Participant
August 31, 2023
Answered

When sending PDF form via email using 'Run Javascript' can you bcc?

  • August 31, 2023
  • 1 reply
  • 1038 views

Hi there! I am trying to create a form that prompts you to submit via email utilizing the Actions > Run Javascript. Is there a way to bcc an email? My current script is below. Any help would be appreciated!

 

var targetEmail = "email"

var cCCAddr = "email; email"

var subjectLine = "ACTION REQUIRED: Status Change Form for: " + this.getField("LEGALNAME").value+" has been submitted.";

var body = "Status Change Form for: " + this.getField("LEGALNAME").value+" has been submitted by: "+ this.getField("SUPERVISORSIG").value+" on "+this.getField("TODAYSDATE").value+". \n\nPlease advise if approved for payroll processing.";

this.mailDoc({cTo: targetEmail, cCc: cCCAddr, cSubject: subjectLine, cMsg: body});

This topic has been closed for replies.
Correct answer Colleen31981045p4tc

Thom - Thank you for that resource. I was able to use that to update the script to the below and it worked.  Including if it helps others. Much appreciated!!

 

var targetEmail = "email"

var cCCAddr = "email;email;"

var cBccAddr = "email" + this.getField("SUPERVISOR EMAIL").value;

var subjectLine = "ACTION REQUIRED: Status Change Form for: " + this.getField("LEGAL NAME").value+" has been submitted.";

var body = "Status Change Form for: " + this.getField("LEGAL NAME").value+" has been submitted by: "+ this.getField("SUPERVISOR_3").value+" on "+this.getField("TODAYS DATE_af_date").value+".\n\nType of change requested is: "+this.getField("STATUS CHANGE TYPE").value+".\n\n" +this.getField("SUPERVISOR_3").value+" Please advise payroll/HR team if approved for processing.";

this.mailDoc({bUI: true, cTo: targetEmail, cCc: cCCAddr, cBcc: cBccAddr, cSubject: subjectLine, cMsg: body});

 

1 reply

Thom Parker
Community Expert
Community Expert
August 31, 2023
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
August 31, 2023

Thanks, Thom. I looked at those references, but don't understand how to script the Bcc as a novice user. Any chance you know the script?

Colleen31981045p4tcAuthorCorrect answer
Participant
August 31, 2023

Thom - Thank you for that resource. I was able to use that to update the script to the below and it worked.  Including if it helps others. Much appreciated!!

 

var targetEmail = "email"

var cCCAddr = "email;email;"

var cBccAddr = "email" + this.getField("SUPERVISOR EMAIL").value;

var subjectLine = "ACTION REQUIRED: Status Change Form for: " + this.getField("LEGAL NAME").value+" has been submitted.";

var body = "Status Change Form for: " + this.getField("LEGAL NAME").value+" has been submitted by: "+ this.getField("SUPERVISOR_3").value+" on "+this.getField("TODAYS DATE_af_date").value+".\n\nType of change requested is: "+this.getField("STATUS CHANGE TYPE").value+".\n\n" +this.getField("SUPERVISOR_3").value+" Please advise payroll/HR team if approved for processing.";

this.mailDoc({bUI: true, cTo: targetEmail, cCc: cCCAddr, cBcc: cBccAddr, cSubject: subjectLine, cMsg: body});