• 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: Admin email depending of the product

Admin email depending of the product 9 years 4 months ago #29504

Hi!
I´m trying to send the email to different direction depending of the product they select in the payment multiple product selector. I have written the same code as I was working with a normal dropdown, but it doesn´t work.
This is my code written in the html Layout:
<script type="text/javascript">
function adminemailscript()
{
if(document.getElementById('multiplepoductfield').value == 'product1')
{document.getElementById('adminemail').value = 'email1@email.com';
}
else
{document.getElementById('adminemail').value = 'email2@email.com';
}
}
</script>
The administrator has disabled public write access.

Admin email depending of the product 9 years 4 months ago #29511

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
The script you have provided seems in order, however there might be issues with the ID's you are using (a working link to your form would be of help to determine this issue).

I would recommend using PHP scrips instead of Javascript (using Javascript implies that you use a hidden field to store the email address).

An example on how to change the "To" address based on a dropdown value and more information can be found here:
http://www.rsjoomla.com/support/documentation/view-article/610-php-email-scripts.html

More information on PHP scripts :
http://www.rsjoomla.com/support/documentation/view-article/602-php-scripts.html
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.

Admin email depending of the product 9 years 4 months ago #29517

Yes it works!thank you.
I tried with this simple code and everuthing is ok:
if($_POST['form']['dropdown'][0] == 'option1')
  $adminEmail['to'] = 'email1';
if($_POST['form']['dropdown'][0] == 'option2')
  $adminEmail['to'] = 'email2';

Thank you!
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!