• 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: Condition for sending additional email

Condition for sending additional email 8 years 2 months ago #36487

We would only like to send an additional email on the condition of a specific radio option being selected on submit. How can we accomplish this? Your help is appreciated.
The administrator has disabled public write access.

Condition for sending additional email 8 years 2 months ago #36491

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Assuming you only have one additional email configured, you can use a similar as the following snippet added within "Script called before the Additional Emails are sent" (while editing your form > Properties > PHP Email Scripts) - replace the first two variables as suggested:
$myRadio = "myRadioGroupNamehere";
$radSel = "myRadioSelectionValue";
if($_POST['form'][$myRadio] != $radSel){
	$additionalEmail['to']='';
}
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

Condition for sending additional email 8 years 2 months ago #36496

Thanks for the quick response. This doesn't seem to be working. A Few tid-bids: here is the code that I have:
<?php
$myRadio = "contract-type";
$radSel = "Member[c]";
if($_POST['form'][$myRadio] != $radSel){
	$additionalEmail['to']='';
}
?>

I also tried
<?php
$myRadio = "contract-type";
$radSel = "Member";
if($_POST['form'][$myRadio] != $radSel){
	$additionalEmail['to']='';
}
 ?>

It still sends the additional emails regardless of what is selected

Should I write the conditions and recipients strictly in the "Script called before the Additional Emails are sent" area? Because, right now I have the "T0:" field pre-populated with the {global:useremail} placeholder and a regular email address. What say you?
Last Edit: 8 years 2 months ago by info@ourblok.com.
The administrator has disabled public write access.

Condition for sending additional email 8 years 2 months ago #36520

Friendly Bump.
The administrator has disabled public write access.

Condition for sending additional email 8 years 2 months ago #36527

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You can leave the additional email normally configured. The script is designed to clear out the TO field if the radio choice isn't the one specified, thus no longer sending the email.

If you've actually included <?php and ?> tags within the scripting area, this is incorrect. Have these removed and test it once more.
This is not official customer support. To receive your support, submit a support ticket here.
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!