Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Customize body of Submit as PDF email?

Avatar

Level 2

How do I change default text in Subject ("Form Returned") and Body ("The attached file is the filled-out form. Please open it to review the data.") of email that results from Submit as PDF to mailto:email address? Is there a .txt file somewhere that contains this information? Thanks!         ~Carol

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Carol,

Here is a sample: https://acrobat.com/#d=awe4XZzrtamYOUcs8pKiPA

You can use a regular button instead of a Submit by Email button. Setting it up is straight forward, the following is script in the click event of the regular button.

// First give a messageBox with instructions

xfa.host.messageBox("This will open your email client and prepare an email for you. " +

     "Please make sure you send the email to complete the process." +

     "\n\nIf you experience any difficulties or if you are using a " +

     "web based email client, then please save this form and " +

     "manually email it to someone@acompany.ie\n\nThank you!", "Email Instructions", 3, 0);


xfa.host.beep("3");


// then pass instructions through to email client

var vEmail = "someone@acompany.ie";    

var vSubject = "A9100 - Example of Email Button Script";

var vBody = "Hi\n\nPlease find attached the completed form in PDF format.\n\nRegards,\n\n" + nameField.rawValue + "\n" + companyField.rawValue;


event.target.submitForm({cURL:"mailto: "+ vEmail +"?subject=" + vSubject +"&body=" + vBody,cSubmitAs:"PDF",cCharset:"utf-8"});

You can hardwire the email addresses, subject line and message into the script or you can have elements of these set to the values of objects on the form.

Hope that helps,

Niall

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Hi Carol,

Here is a sample: https://acrobat.com/#d=awe4XZzrtamYOUcs8pKiPA

You can use a regular button instead of a Submit by Email button. Setting it up is straight forward, the following is script in the click event of the regular button.

// First give a messageBox with instructions

xfa.host.messageBox("This will open your email client and prepare an email for you. " +

     "Please make sure you send the email to complete the process." +

     "\n\nIf you experience any difficulties or if you are using a " +

     "web based email client, then please save this form and " +

     "manually email it to someone@acompany.ie\n\nThank you!", "Email Instructions", 3, 0);


xfa.host.beep("3");


// then pass instructions through to email client

var vEmail = "someone@acompany.ie";    

var vSubject = "A9100 - Example of Email Button Script";

var vBody = "Hi\n\nPlease find attached the completed form in PDF format.\n\nRegards,\n\n" + nameField.rawValue + "\n" + companyField.rawValue;


event.target.submitForm({cURL:"mailto: "+ vEmail +"?subject=" + vSubject +"&body=" + vBody,cSubmitAs:"PDF",cCharset:"utf-8"});

You can hardwire the email addresses, subject line and message into the script or you can have elements of these set to the values of objects on the form.

Hope that helps,

Niall

Avatar

Level 2

This worked great, Niall. Thanks! Is it possible to apply bold, underline, color, etc. to any text in that messageBox? If so, where do I find a list of available codes?             ~Carol

Avatar

Level 10

Hi,

I am not sure - it may be possible with unicodes, but I don't have the particular codes. I tried \uF3C7 and \uF3C6 but that didn't work.

Maybe someone else will have an answer,

Niall