Is it possible to generate the email subject from a user-filled text field?
For example:
When the user enters 'John Doe' for their name in a form, the subject line would be 'John Doe'.
<submit format="pdf" textEncoding="UTF-8" target="mailto:mbox@company.com?subject=<John Doe>"/>
Solved! Go to Solution.
Made some minor changes to your script to get what I needed:
var myDoc = event.target;
var address = "myemail@contoso.com, secondemail@contoso.com";
var subject = [TargetFieldName1.rawValue, TargetFieldName2.rawValue, " Additional Static Text"];
subject.toString();
myDoc.mailDoc({
bEmpty: true,
cTo: address,
cSubject: subject,
csubmîtAs: "PDF"
});
Also, I found out I needed a normal button that calls this script when clicked. Otherwise, thank you for getting me pointed in the right direction.
Views
Replies
Total Likes
I believe this FAQ will help you achieve it: http://forums.adobe.com/thread/977632
Views
Replies
Total Likes
Another method is using my macro (usable in Designer ES2 or higher).
You can create a complete mail (recipients, subject and message) and add variables from fields to all of them.
http://thelivecycle.blogspot.de/2012/05/mailto-maker-marco-v1.html
Views
Replies
Total Likes
Use can use this script for getting subject from textfield
var myDoc = event.target;
var address = "";
var subject = TextField.rawValue,
myDoc.mailDoc({
bEmpty: true,
cTo: address,
cSubject: subject,
csubmîtAs: "PDF"
});
You'll have to forgive my ignorance, but I don't understand much about scripting. Right now, I'm using the 'Email Submit Button' and don't know where to put the suggestions above. Could someone provide an example please?
Views
Replies
Total Likes
Made some minor changes to your script to get what I needed:
var myDoc = event.target;
var address = "myemail@contoso.com, secondemail@contoso.com";
var subject = [TargetFieldName1.rawValue, TargetFieldName2.rawValue, " Additional Static Text"];
subject.toString();
myDoc.mailDoc({
bEmpty: true,
cTo: address,
cSubject: subject,
csubmîtAs: "PDF"
});
Also, I found out I needed a normal button that calls this script when clicked. Otherwise, thank you for getting me pointed in the right direction.
Views
Replies
Total Likes
I can't seem to get this to fire when in the "click" event of my button. Am I missing any essential bits?
I'm in the same boat as G5_Matty.
I've used the same coding, just adding in my data to suit, but I can't seem to get the button to work?
It's not telling me I have any coding errors either.
Views
Replies
Total Likes
Hi,
This code needs to be in a standard button, but it also has a few problems.
Try this code
var myDoc = event.target;
var address = "myemail@contoso.com; secondemail@contoso.com";
var subject = [TargetFieldName1.rawValue, TargetFieldName2.rawValue, " Additional Static Text"];
myDoc.mailDoc({
bEmpty : true,
cTo : address,
cSubject : subject.join(" "),
csubmitAs : "PDF"
});
Regards
Bruce
Views
Replies
Total Likes
Views
Likes
Replies