• 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: Script to send/not send email based on field value

Script to send/not send email based on field value 5 years 4 months ago #38615

I have the following script in the 'Script called before the Admin Email is sent' section in my original form. This is looking for a value of a certain radio button in the form and only sending the admin email if the value is equal to Submit.
if ($_POST['form']['submitOption'] == "submit") {
   $adminEmail['to'] = 'info@clarkgreenneighbors.org, goldilaks@me.com';
} else {
   // Don't send the email.  RSJoomla says empty these two values and the email will not be sent.
   $adminEmail['to'] = NULL;
   $adminEmail['from'] = NULL;
}

Is there any way to do something similar in an email script in the Manage Directories area? I would like to check that same field, and only send one of the specific directory emails if the field is equal to 'submit' (the other email should always send). Or alternatively, if I could change the 'to' address on one of the emails if the field is equal to 'submit'.

Any ideas?
Thanks,
Karen
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!