Expand my Community achievements bar.

SOLVED

Help with form submit - cc

Avatar

Former Community Member

Hi all, this is probably really basic stuff for you all, so bear with me, I have the code below as part of a submit button that I use for various different forms without any problems, but what I want to do is add a single "cc" address to the code, so that the form I am currently working on goes to that address as well as the one from the drop-down list... can anybody help?

Many thanks

if (DropDownList1.rawValue != null){
RealEmail.event__click.submit.target = "mailto:" + DropDownList1.rawValue + "?subject=" + Subject.rawValue;
//app.alert(RealEmail.event__click.submit.target);
RealEmail.execEvent("click");
} else {
app.alert("Please select a user from the dropdown!");
}

1 Accepted Solution

Avatar

Correct answer by
Level 10

I sent the updated form in a separate email.

Let me know if that helps.

Thanks

Srini

View solution in original post

11 Replies

Avatar

Former Community Member

Thanks Srini

It's all good stuff, but I can't figure out what to do to add a specific, single cc address to the one chosen from the dropdown list script I am using, as I want to do both together... Probably being stupid, but can anyone help any further with this?

Avatar

Level 10

//Declare variables to hold the values

var strToAddress, strCCAddress, strSubject, strMessage

//Assign the values from form fields to the variables
strToAddress = txtToAddress.rawValue;
strCCAddress = txtCCAddress.rawValue;
strSubject = txtSubject.rawValue;
strMessage = txtMessage.rawValue;

In the above assignment, I am assigning the value of "txtCCAddress" to the variable. If you have a specific email address to be sent as CC then you can directly assign the email to this variable.

strCCAddress = ccEmail@myCompany.com;

event.target.submitForm({cURL:"mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF"});

Hope this helps.

Thanks

Srini

Avatar

Former Community Member

Thanks Srini,

Really appreciate your help with this, but I what I'm struggling with is incorporating the cc address into this particular code fragment. I thought you could just add a cc instruction into the line directing it to a textfield with the address in [see example] but I just can't get it to work! I have tried adapting the code you gave me but can't find a way to make that work either... sorry if i am being slow, am storing all the other code snippets for future reference!

Many thanks

if (DropDownList1.rawValue != null){
RealEmail.event__click.submit.target = "mailto:" + DropDownList1.rawValue + "?cc=" + CCTextField.rawValue + "&subject=" + Subject.rawValue;
//app.alert(RealEmail.event__click.submit.target);
RealEmail.execEvent("click");
} else {
app.alert("Please select a user from the dropdown!");
}

Avatar

Level 10

May be you can post the form, so I can have a look at it..

Thanks

Srini

Avatar

Correct answer by
Level 10

I sent the updated form in a separate email.

Let me know if that helps.

Thanks

Srini

Avatar

Former Community Member

Brilliant, works like a charm... thanks very much Srini, you've been great.

Cheers

Avatar

Former Community Member

Hi Srini,

Using your codes, I rewrite it this way but I could not make the CC work right. It keep using the email address in the ToAddress so both of the ToAddress and CCAddress are always the same. Note that I am using GroupWise 7 as the client email.

/Assign the values from form fields to the variables
strToAddress = "test1@abc.com";
strCCAddress = "ccEmail@myCompany.com";
strSubject = "Craft Issue Tracking Form" ;
strMessage = "Please see the attached form.";;

event.target.submitForm({cURL:"mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF"});

Can you help on this.

Thanks in advance,

Han Dao

Avatar

Former Community Member

Just tried your code amd it worked fine (so you know it is not the code)...but I use Outlook ...sounds like it might be a GroupWise issue. You might try changing over to a mailto command and see if the issue still exists.

paul

Avatar

Former Community Member

Hi Paul,

I think it may be the GroupWise thing too. I try mailto thing and it does the same thing too. I even tried the submit by email button but it still does the same thing. I am not sure what I can do now.

Thanks,

Han Dao

Avatar

Former Community Member

I seem to remember issues with GroupWise before .....you might want to check with support and see if they have any advice.

Paul