Note to moderator: I'm not sure there is any NEW info in this post after AlexP's answer. It's a follow up to this post:
www.rsjoomla.com/forum/37-rsform-pro/264...ened-to-my-post.html. I just want to see if TODAY I get the white screen with smiley face OR the post actually succeeds into the forum.
Hello,
Andrei Cristea answered this support question for me. I think the answer would be helpful to others, so I'm copying the thread to the public forum. The posts are arranged newest at the top, original question at the bottom. Some URL's and emails have been changed for privacy.
Also this link from the RSForm!Pro support documentation covers this topic in a more general way, with more examples:
www.rsjoomla.com/support/documentation/r...p-email-scripts.html
I'm using Joomla 3.4.3
15/09/2015 22:28:09
Carol Mattsson wrote:
Your answer works just fine for me. Thank You! And thank you for answering so promptly.
FYI, here is my new code in the PHP mail scripts section, additional emails box:
if ($_POST['form']['Send To Me'] == "Yes") {
// Keep this in while testing
//$additionalEmail['to'] = "dino@example.net";
} else {
// Don't send the email. RSJoomla says empty these two values and the email will not be sent. CEM 9/15/2015
$additionalEmail['to'] = NULL;
$additionalEmail['from'] = NULL;
}
--Carol
15/09/2015 10:06:27
Andrei Cristea wrote:
Hello,
In order for the email to be generated you will need to have valid email addresses or placeholders that return valid email addresses in both the "To" and "From" fields. You could try adding a script in `PHP Email Scripts" that will check the user's input and if an email should not be sent empty the following values:
and
Regards!
15/09/2015 00:29:44
Carol Mattsson wrote:
Hello,
I have successfully set up an "Additional Email" to be sent when my form is submitted. However I want to send this email only if a certain radio button on the form is ticked.
I have successfully set up a PHP script that can change the email address to which this additional email will be sent, according to the value of that certain radio button. I do that by altering the value of a hidden variable in my form. The hidden variable is supplied as the "to" address of this additional email.
Here is a snapshot of my form:
www.dropbox.com/s/l7qypi2boivatl1/rsjoom...mail-option.JPG?dl=0
For now I've set this address to a non-working email address when I don't wish the additional email to be sent out. But is there a better, more elegant way to handle this situation? I'd rather find a way to NOT send out an email at all, based on the value of that radio button.
Here is my script (called on form process):
if ($_POST['form']['Send To Me']) {
$_POST['form']['PGE Notify Email'] = "dino@example.com" ;
} else {
$_POST['form']['PGE Notify Email'] = "bit-bucket@example.com";
}
Any suggestions?
Thank you.
--Carol Mattsson