Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

mailto: using a parameter on the adobe form.

Avatar

Former Community Member
I'm wanting to use a submit form with a mailto: function that will mail the form to the email address in a email text box on the form. Everything I have seen uses hard coded email addresses.



mailto:myemail@hotmail.com?cc=myemail@yahoo.com

I want to

mailto:"value in email text box 1"?cc= "value in email text box 2"



Thanks in advance.



Jason
7 Replies

Avatar

Former Community Member
Hey Jason I am looking for the same thing. I have a txt field on my form called Manager Email and when they click submit I would like to send the email to managers email that is in the text box on the form.

Avatar

Former Community Member
If you have a submit button that uses the mailto protocol you can use this command to set the URL:



ButtonName.event__click.submit.target = "mailto:" + Fieldname.rawValue + any other options to the string that you want;

Avatar

Former Community Member
Thanks Paul. That did the trick. Here is the code that I used for my Managers_email field that is on the form. But now I have the issue of once I push the submit button it does not check for the required fields. I did this as a click event. Im not sure what a mouseup event is as I have seen others talk about using the mouseup event.



var oDoc = event.target;

oDoc.mailDoc({

bUI: true,

cTo: "email@myemail.com;" + Managers_email.rawValue,

cCc: "email2@myemail.com",

cSubject: "New Loss Memo",

cMsg: "The attached file is a filled-out form blah blah blah."});

Avatar

Former Community Member
The click is the event you should be using. The check does not happen because you did not do a submit. You could add the command form1.execValidate() before you do the email.

Avatar

Former Community Member
Seems I cant get it to work. I get a dialog box that says None and then it goes to send out the email. Any thoughts? I even tried form1.#subform[0].execValidate(); doing it with and without the ; for both ways.



form1.#subform[0].Button1::click - (JavaScript, client)

form1.execValidate();

var oDoc = event.target;

oDoc.mailDoc({

bUI: true,

cTo: "email@myemail.com;" + Managers_email.rawValue,

cCc: "email2@myemail.com",

cSubject: "New Loss Memo",

cMsg: "The attached file is a filled-out form blah blah blah."});

Avatar

Former Community Member
Lets run a test .....in Designer add an email submit button from the Standard Object Library. Render the form and hit that button. See if any warnings about mandatory fields get shown.

Avatar

Former Community Member
Yep Did that also :) and I do get the warnings expected. If your thinking what Im thinking is add the submit button and add an onclick event to execute the other button. I tried that also.. lol. and I also get the warning but then it proceeds to run the mailto code and send the email.. Not sure if I may have missed something or maybe my code in the submit button is missing something.