Submitting form by email to include field value as CC

Jul 25, 2019

Copy link to clipboard

Copied

I have a text field (named DeptEmail), which automatically populates based on the selection from a dropdown field.  I want the text from DeptEmail to added as a CC when the submit form button is selected.

My inspiration came from the following link: https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address and my current JavaScript looks like this:

// This is the form return email.  It's hardcoded

// so that the form is always returned to the same address.

// Change address on your form to match the code below

var cToAddr = "email@email.com";

//Now get the CC email address

var cCCAddr = this.getField("DeptEmail").value;

// Set the subject and body text for the email message

var cSubLine = "CRT Submission";

var cBody = "This CRT and attachments are hereby submitted.";

// Send the entire PDF as a file attachment on an email

this.mailDoc({bUI: true, cTo: cToAddr, cCC: cCCAddr, cSubject: cSubLine, cMsg: cBody});

The button works on every level EXCEPT it does not add the CC.  Any suggestions?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

117

Likes

Translate

Translate

Report

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

Submitting form by email to include field value as CC

Jul 25, 2019

Copy link to clipboard

Copied

I have a text field (named DeptEmail), which automatically populates based on the selection from a dropdown field.  I want the text from DeptEmail to added as a CC when the submit form button is selected.

My inspiration came from the following link: https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address and my current JavaScript looks like this:

// This is the form return email.  It's hardcoded

// so that the form is always returned to the same address.

// Change address on your form to match the code below

var cToAddr = "email@email.com";

//Now get the CC email address

var cCCAddr = this.getField("DeptEmail").value;

// Set the subject and body text for the email message

var cSubLine = "CRT Submission";

var cBody = "This CRT and attachments are hereby submitted.";

// Send the entire PDF as a file attachment on an email

this.mailDoc({bUI: true, cTo: cToAddr, cCC: cCCAddr, cSubject: cSubLine, cMsg: cBody});

The button works on every level EXCEPT it does not add the CC.  Any suggestions?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

118

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 25, 2019 0
Jul 25, 2019

Copy link to clipboard

Copied

The name of this parameter is cCc, not cCC.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 25, 2019 1
Jul 25, 2019

Copy link to clipboard

Copied

Wow!  I never would have caught that.  I'm seriously so thankful for this support forum!  Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 25, 2019 0
Jul 25, 2019

Copy link to clipboard

Copied

You probably copied the example from the documentation, where it's unfortunately incorrect...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 25, 2019 0
Jul 25, 2019

Copy link to clipboard

Copied

That I did, unfortunately.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 25, 2019 0