Email button scripting


i have drop-down object (supervisorlist), textfield (employeeemail) , button object (supervisoremail). when supervisoremail button clicked, 3 things need happen;

 

  1. the script needs address email message supervisorlist rawvalue address
  2. check see if address 1 of 3 addresses (person1@company.com, person2@company.com or person3@company.com) , if yes, cc: person4@company.com
  3. also copy employeeemail address if not null.

 

 

i'm @ loss on how accomplish this. script:

 

form1.subform3.approvals.supervisor.supervisoremail::click - (javascript, client)

var vemail;
var vsubject = "vacation/personal leave request";
var vbody = "comments:"; 
var vcc;

if (employeeinfo.supervisorlist.rawvalue !== null) {
     vemail = employeeinfo.supervisorlist.rawvalue;
}
if (this.rawvalue == "person1@company.com" || this.rawvalue == "person2@company.com" || this.rawvalue == "person3@company.com"){
     "&cc" = "person4@company.com" + ";";
}
if (employeeinfo.employeeemail.rawvalue !== null){
     vcc = "&cc=" + employeeinfo.employeeemail.rawvalue;
}
else if (employeeinfo.employeeemail.rawvalue === null)  {
     vcc = "&cc=";
}
{
// send email
event.target.submitform({curl:"mailto: " + vemail + "?subject=" + vsubject + "&body=" + vbody + vcc,csubmitas:"pdf",ccharset:"utf-8"});
}

hi,

 

i think may have seen example: http://assure.ly/dyqfb4.

 

if have see how deal cc part of script. have error there @ moment.

 

for example if script in supervisoremail button, wont have .rawvalue. therefore need refer dropdown , not "this".

 

also when setting vcc variable, need this:

 

var vcc = ""; 

 

then deal declaring of vcc:

 

if (supervisorlist.rawvalue == "person1@company.com" || supervisorlist.rawvalue == "person2@company.com" || supervisorlist.rawvalue == "person3@company.com") {      vcc = "&cc" + "person4@company.com" + "; "; }  if (employeeinfo.employeeemail.rawvalue !== null) {      if (vcc == "") {           vcc = "&cc=" + employeeinfo.employeeemail.rawvalue;      }      else {           vcc = vcc + employeeinfo.employeeemail.rawvalue;      } } 

 

hope helps,

 

niall



More discussions in LiveCycle Designer


adobe

Comments