• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Send Email to Recipients Listed in a Drop Menu

Send Email to Recipients Listed in a Drop Menu 14 years 3 months ago #13050

  • stuffpod
  • stuffpod's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hello, hoping I can get some help from the community on this one...

I followed the instructions in the RSForm! Pro video (see below) to create a form that sends its results to recipients determined by the user's selection from a drop-down menu.

Video: www.rsjoomla.com/tv/44-episode-7-how-to-...drop-down-field.html

Upon form submission, the "Could not instantiate mail function" error appears on the page.

The User receives the automatic email just fine. However, the Admin Emails are not being sent.

When I manually enter an email address into the Admin Email "To" field or even multiple email addresses separated by a comma, rather than the Quick Add Tag {Interest:value}, it works fine.

This proves that the problem is not the email addresses or my Joomla setup (I can register a new user just fine).

It must have something to do with the RSForm Pro software - perhaps the syntax or some other setting I'm missing?

I am carefully using the syntax described in the video and User Guide:

email@domain.com|Choice1

This does not work, even with a single email address. (I'd actually like to have it send to multiple email addresses for each option - as in: email1@yahoo.com,email2@gmail.com|Choice1 - however, at this point, even one isn't working).

I am also occasionally see another message that may be impacting this:

This e-mail address is being protected from spambots. You need JavaScript enabled to view it
<script language='JavaScript' type='text/javascript'>

I've tried every email option in the Global Config (PHP, SMTP, etc.) to no avail.

After reviewing all the RSForm! Pro documentation I could find, I tried everything I found...

Here: www.rsjoomla.com/customer-support/docume...-function-error.html

And Here: www.rsjoomla.com/customer-support/docume...-not-being-sent.html

These things did not fix it. I am sure it has to do with something in the RSForm Pro software - I just don't know what.

Is there a new or better way of doing this now? Anyone have any ideas?

Thank you for your help.
The administrator has disabled public write access.

Re:Send Email to Recipients Listed in a Drop Menu 14 years 2 months ago #13331

I'm having the exact same problem - did you find a solution?
The administrator has disabled public write access.

Re:Send Email to Recipients Listed in a Drop Menu 14 years 2 months ago #13339

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

If you have placed the form inside and article, this is most likely generated by the Joomla! email cloaking plugin. Please disable it (Extensions > Plugin Manager) and try again.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:Send Email to Recipients Listed in a Drop Menu 14 years 2 months ago #13350

Perfect!
Worked a treat!
The administrator has disabled public write access.

Re:Send Email to Recipients Listed in a Drop Menu 14 years 2 months ago #13449

But with cloaking disabled on the whole site anytime you list your email it could be picked up by spambots? Is this the only solution?
The administrator has disabled public write access.

Re:Send Email to Recipients Listed in a Drop Menu 14 years 1 month ago #13484

  • bpcvicau
  • bpcvicau's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
I dont have a problem with sending emails from a dropdown box based like

email@domain.com|Choice1 where email address gets the form submission and the Choice1 appears in the dropdown box.

I do have a problem as I have the first drop down box contain multiple sites. The second dropdown box will show the names from the particular site based off the first drop down box limitting the names that appear.

The code I have being using is:

<script type="text/javascript">
function dynamic1(parent,child)
{
var parent_array = new Array();
// This is the default value
parent_array = ;
// All other elements

parent_array = ;
parent_array = ;

// Get the child
var thechild = document.getElementById(child);

// Remove all other options from the select element
thechild.options.length = 0;

// What value are we looking for ?
var parent_value = parent.options[parent.selectedIndex].value;

// No value found, use the default value
if (!parent_array[parent_value]) parent_value = '';

// Set the correct length
thechild.options.length = parent_array[parent_value].length;

// Add the options
for(var i=0;i<parent_array[parent_value].length;i++)
{
thechild.options.text = parent_array[parent_value];
thechild.options.value = parent_array[parent_value];
}
}
</script>

When the emails are sent, they are sent like

This e-mail address is being protected from spambots. You need JavaScript enabled to view it
|@webhostingcompany.com
This e-mail address is being protected from spambots. You need JavaScript enabled to view it

I know how the | pipe works normally however how do you work it in the code as the email address and Choice Label is visible in the dropdown box.

thanks in advance
The administrator has disabled public write access.

Re:Send Email to Recipients Listed in a Drop Menu 14 years 1 month ago #13499

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 745
  • Thank you received: 66
Hello,

If I understand correctly you want to use a pipe when generating the second dropdown. In order to achieve this you will need to make some adjustment to the script by replacing:
// Add the options
for(var i=0;i<parent_array[parent_value].length;i++)
{
thechild.options[i].text = parent_array[parent_value][i];
thechild.options[i].value = parent_array[parent_value][i];
}

with this ones:
// Add the options
for(var i=0;i<parent_array[parent_value].length;i++)
{
var x = parent_array[parent_value][i].split('|');
 
thechild.options[i].text = x[1];
thechild.options[i].value = x[0];
}
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:Send Email to Recipients Listed in a Drop Menu 13 years 8 months ago #15145

i have the same issue with dynamic dropdown with email recipients.. have you manage to find the solution?
The administrator has disabled public write access.

Re:Send Email to Recipients Listed in a Drop Menu 13 years 2 months ago #16936

moldygrrl@gmail.com wrote:
But with cloaking disabled on the whole site anytime you list your email it could be picked up by spambots? Is this the only solution?

I know this was posted a long time ago but since I didn't see an answer to this specific question, I thought I'd reply to let people know that there's a way to disable on just one page. Put the following in the text of the article where you are embedding rsform (before the {rsform #} tag):

{emailcloak=off}

See docs.joomla.org/Screen.plugins.edit.15#Content_-_Email_Cloaking
The administrator has disabled public write access.

Re: Send Email to Recipients Listed in a Drop Menu 12 years 8 months ago #19405

  • Moosegun
  • Moosegun's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
I have a question on a similar topic, I want to set up a form which sends emails to different users depending on the option selected in the drop, which I can work out how to do. The issue is though that I want to also send value within the dropdown within the email and I cant work out how to do it.
The administrator has disabled public write access.

Send Email to Recipients Listed in a Drop Menu 3 weeks 1 day ago #43972

  • azurelink
  • azurelink's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 32
  • Thank you received: 3
I'm also trying to set my form up to send admin emails to addresses based on the options in a dropdown field. The field syntax "admin@domain.com|Option 1" works, however I want the values for the options to be the same as the labels, not the email addresses. So I've removed the value part of the Items (and the pipes) from the field.

Another factor is that in two cases, two of the options need to be sent to the same admin email address.

I came across a script here which purports to do this:

www.rsjoomla.com/support/documentation/r...d-on-selection-.html

I tried testing my script (below) but the error says that I need to choose a recipient address. What do I need to place in the Admin Email "To" field? I tried the field name value placeholder, I tried $adminEmail variable, I tried leaving the field empty — no joy.

Here's my script:

if($_POST[0] == 'Option1' || $_POST[0] == 'Option4' || $_POST[0] == 'Option5')
$adminEmail = ' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';

elseif($_POST[0] == 'Option2' || $_POST[0] == 'Option3')
$adminEmail = This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';

elseif($_POST[0] == 'Option6')
$adminEmail = ' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';

All help is appreciated!
The administrator has disabled public write access.

Send Email to Recipients Listed in a Drop Menu 3 weeks 17 hours ago #43974

  • azurelink
  • azurelink's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 32
  • Thank you received: 3
UPDATE:

In my case, I didn't need to use a script to accomplish this. I set up the dropdown field with the email addresses where the value goes before the label and pipe character like this:
user1@domain.com|Choice 1
user2@otherdomain.com|Choice 2

And then in the Admin Email "To" field, I put in the following placeholder:
{dropdown_field_name:value}
Which sends the email to the address in the select list.

And in the Admin Email body I put in this placeholder to get the "label" text to display:
{dropdown_field_name:text}

Thanks to Octavian for the solution!

==== ANOTHER UPDATE:

The above solution had the following issues:

Instead of writing a single dropdown option to the email placeholder and the database, it was placing all dropdown options text in as defined in the combined statement.

Reworked the field and added an PHP Email Script in Form Properties as follows:

1. Changed the dropdown option back to this format where the value matches the label text:
Choice 1|Choice 1
Choice 2|Choice 2
Choice 3|Choice 3

2. Created this script and placed it in the Form Properties/PHP Email Script:
if($_POST['form']['field_name'][0] == 'Choice 1')
$adminEmail['to'] = 'john@domain.com';
 
elseif($_POST['form'][''field_name'][0] == 'Choice 2')
$adminEmail['to'] = 'linda@domain.com';
 
elseif($_POST['form'][''field_name'][0] == 'Choice 3')
$adminEmail['to'] = 'jane@domain.com';
Last Edit: 2 weeks 6 days ago by azurelink. Reason: Added code tags.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!