Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Aug 31, 2023 Aug 31, 2023

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});

TOPICS
Acrobat SDK and JavaScript
802
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Aug 31, 2023 Aug 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: "+ t

...
Translate
Community Expert ,
Aug 31, 2023 Aug 31, 2023

See the reference entry:

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/doc.html#maildoc

 

Read this article:

https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address/

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2023 Aug 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2023 Aug 31, 2023
LATEST

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});

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines