Jump to content
  • 0

Acknowledgement Email Multiple Emails Via Parameters


flosie0901

Question

I want to send an acknowledgement email to two parameters when a form is submitted, and also a third if that field is not blank. Two are cascading text fields that auto complete if available, and the other is filled in if the user submitting the request is not the person to whom this email belongs and enters their own email.

 

Basically it is:

Regional Manager

Manager

Submitter (this may or may not be a blank field)

 

How do I send the acknowledgement email to all three, if all three are available- or at least to however many are available.

 

Thanks!

Link to post
Share on other sites

5 answers to this question

Recommended Posts

Hi Flosie,

 

How are you doing?

 

I think, you can use the following steps:

Add a Virtual field and select a Hidden FormElement for it, then add the Header&Footer element, select the Footer, click the Source button and enter the code:

<SCRIPT LANGUAGE="JavaScript">
function emails()
{
var Regional_Manager = "Regional_Manager";
var Manager = "Manager";
var Submitter = "Submitter";

Regional_Manager = "InsertRecord" + Regional_Manager;
Manager = "InsertRecord" + Manager;
Submitter = "InsertRecord" + Submitter;

var email_Regional_Manager = document.getElementsByName(Regional_Manager)[0].value;
var email_Manager = document.getElementsByName(Manager)[0].value;
var email_Submitter = document.getElementsByName(Submitter)[0].value;

var emailsList = email_Regional_Manager + ";" + email_Manager;
if (email_Submitter.length>3) result_email = emailsList + ";" + email_Submitter;

document.getElementById("cbParamVirtual1").value = emailsList;
}
document.getElementById("caspioform").onsubmit=emails;
</SCRIPT>

And then select your Virtual field as an address for your Acknowledgment email.

Please note, if the Virtual Field is not the first, you should change the "cbParamVirtual1" to the correspond number, for example, to "cbParamVirtual3".

 

Could you please let me know, if it works? :)

 

Have a nice week-end!

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...