• 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: Multiple dependencies to send additional email

Multiple dependencies to send additional email 6 years 9 months ago #38358

I have read and understood www.rsjoomla.com/support/documentation/r...p-email-scripts.html and managed to send additional emails to different addresses based on drop-down values.
But, for an ordering form I'm making, i need to be able to send these emails to different addresses based on more than one drop-down / radio selection.
Sadly, I can't get this to work with normal PHP operators and multiple conditions in the PHP email script -> scripts called before additional emails is sent field. This is what I've tried:

if($_POST[0] == 'value1' && $_POST[0] == 'value2')
$additionalEmail = ' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';

Any suggestions? Is this even possible to achieve?
The administrator has disabled public write access.

Multiple dependencies to send additional email 6 years 9 months ago #38361

I have also tried the following code, to no avail:

$var1 = 'value1';
$var2 = 'Yes';
$var3 = 'value2';
$var4 = 'product 1';
if($_POST == '$var2'&&$_POST == '$var4'){
$additionalEmail = ' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';
}
The administrator has disabled public write access.

Multiple dependencies to send additional email 3 years 3 days ago #42011

  • duncan
  • duncan's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 1
Hi Jon,

I know it's a while since you posted this, but I'm trying to figure out something similar.

Did you ever figure it out?

Thanks

Duncan
The administrator has disabled public write access.

Multiple dependencies to send additional email 3 years 3 days ago #42012

Hi, Duncan :)

Yes, I did.
Here is the syntax to be put in the $additionalEmail array under PHP Email scripts, where req1 is a dropdown and req2 is a radio button group:

if($_POST[0] == 'dropdown_somevalue' && $_POST == 'radiobutton_somevalue')
$additionalEmail = ' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';

Of course, you will need to replace req1_name, req2_name, dropdown_somevalue and radiobutton_somevalue with the actual values from you form.
Observe the [0] after req1_name, this is only for dropdowns. I mean to remember this was the main reason I couldn't get it to work in the first place.

You can have as many of these if-statements as you wish, with different fields and values.

Additionally, you need to configure one (and this will work only with one) additional email text in the Additional Email setup, with no receiver email address.

Hope you are able to achieve what you need :)

Regards
The administrator has disabled public write access.

Multiple dependencies to send additional email 3 years 2 days ago #42014

  • duncan
  • duncan's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 1
Thanks Jon.

Your reply helped me solve my problem.

Regards

Duncan
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!