• 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

Re:Send Email to Recipients Listed in a Drop Menu 14 years 2 months 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 3 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 1 month 4 days 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 1 month 3 days 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: 1 month 2 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!