Copy link to clipboard
Copied
Hello,
I am working in InDesign creating a custom form. I am making my email address an active link. I want the subject line to pull from a fillable textbox (company name). So when I recive emails from customers each one has a logical subject line.
How do I do that?
Thanks
dh23403567 wrote
paste below into script box
var cSubLine = "Leading text you want to appear on every subject line, from" + this.getField("companyName").value;
var cBody = "Any text you want to automatically appear in the email body"
this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});
You missed the cToAddr variable. The first line should be:
var cToAddr = "youremailaddress@yourdomain.com"
I'm sorry I didn't catch that sooner.
Copy link to clipboard
Copied
This can't be setup in InDesign, but it can be added to your email link after export to PDF using Javascript in Acrobat DC. If you're interested, post back here saying so and I'll demonstrate.
Copy link to clipboard
Copied
Yes please. I'd appreciate the help
Thanks for your time
Copy link to clipboard
Copied
Notes:
Copy link to clipboard
Copied
Unfortunately It didn't work. I click the new button and nothing. I tried a button text box a few things.
Any idea where it went wrong?
Copy link to clipboard
Copied
dh23403567 wrote
Any idea where it went wrong?
Without a lot more detail about what you've actually got there, of course I could only guess. Does your email client respond to a simple mailto: linkage?
Instead of the whole script, you could try just:
doc.mailDoc({bUI: true});
That should trigger a new email with a copy of the PDF attached.
Copy link to clipboard
Copied
I'm sorry I should have been more clear.
When I say it didn't work I mean nothing happened in acrobat when I clicked.
It didn't evoke my email system, give an error nothing.
The email hyperlink link worked for sending from InDesign.
I removed it before I tried to set it up in Acrobat
Thanks
Copy link to clipboard
Copied
My Steps so far
Acrobat Pro DC (to add email prompt box)
InDesign CC (to create base form)
Select Prepare Form
Add a "Print Clear or any other type of button"
Properties - Actions - Mouse up - run javascript
paste below into script box
var cSubLine = "Leading text you want to appear on every subject line, from" + this.getField("companyName").value;
var cBody = "Any text you want to automatically appear in the email body"
this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});
Close Prepare form options.
Click box
Nothing happens
Copy link to clipboard
Copied
Do you have a field named companyName (exactly)?
Copy link to clipboard
Copied
Yes, exactly the same.
If you have an address that can receive files, I could email you a file that only contains the text field and the button.
Copy link to clipboard
Copied
dh23403567 wrote
paste below into script box
var cSubLine = "Leading text you want to appear on every subject line, from" + this.getField("companyName").value;
var cBody = "Any text you want to automatically appear in the email body"
this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});
You missed the cToAddr variable. The first line should be:
var cToAddr = "youremailaddress@yourdomain.com"
I'm sorry I didn't catch that sooner.
Copy link to clipboard
Copied
Seems like this is going to to the trick!.
Thanks for your help. It is very much appreciated.
Copy link to clipboard
Copied
I'm glad you've got it sorted out. You are welcome.
Copy link to clipboard
Copied
If you have any ideas for creating an order form that could be used on mobile devices or web browsers, I'd greatly appreciate it.
Copy link to clipboard
Copied
The best idea is to forget about InDesign and PDF and create a form on the website.
Copy link to clipboard
Copied
Thanks for your feedback Bob.
Could you be more specific, are you referring to a do it yourself website creator?
What website is "the website"
Thanks
Copy link to clipboard
Copied
The best idea is to forget about InDesign and PDF and create a form on the website.
dh,
Bob's comment echos my offline reply to you regarding the pitfalls of broadcast PDF forms, and my recommendation that HTML forms are a better solution for universal consistency. I expect by "the website" he refers to your (or your client's) company web site, or whatever web space you might have available to host a form.
Copy link to clipboard
Copied
John’s explanation is exactly what I was referring to.
Are you saying you don’t have a website?
Copy link to clipboard
Copied
Yes we do. I have never created a custom html form and am looking for some tutorials or a program to help build a custom form.
Thanks again guys.
Copy link to clipboard
Copied
Is it a WordPress site?
Copy link to clipboard
Copied
I'm just providing content. I don't have any details on the site development.
Copy link to clipboard
Copied
Then I can’t help here. If you can find out more about the site, I might be able to give you a bit more guidance.
Copy link to clipboard
Copied
I appreciate your time trying to help me.
Thanks
Copy link to clipboard
Copied
This may be optional, but I'd recommend that you rename your [company name] field (can be done in InDesign or Acrobat) to eliminate the space. I use camelCase, so I'd make it "companyName"
Then, in Acrobat, enter Form Edit mode and go to your email link.
var cToAddr = "youremailaddress@yourdomain.com"
var cSubLine = "Leading text you want to appear on every subject line, from" + this.getField("companyName").value;
var cBody = "Any text you want to automatically appear in the email body"
this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});
Copy link to clipboard
Copied
With regards to:
var cBody = "Any text you want to automatically appear in the email body"
How does one include a paragraph space into the body of the email, so we can say, for example:
Dear Mrs....,
[paragraph space]
Please find attached to this email, etc....
Your reply above has been very helpful for a project I am currently working on, I would be grateful to know how to further expolit this cool tip.
Thanks so much!