• 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: Send conditional email user

Send conditional email user 12 years 6 months ago #19253

  • betrained
  • betrained's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 1
I have a checkbox with 2 values : Tarifs - Newsletter
and 3 text fields (Nom, téléphone, email)
I would like to send after the submission the User email only if "Tarif" is checked.

Do U have any idea about it ?
Thanks a lot.
The administrator has disabled public write access.

Re: Send conditional email user 12 years 6 months ago #19305

  • betrained
  • betrained's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 1
In order to achieve this use a php script added in (your form > Properties > PHP Email Scripts) "Script called before the User Email is sent" area.The script should be similar to:

if(!empty($_POST))
{
$userEmail=$_POST;
}


Please make sure that the "To" field from the User Emails tab is empty(your form > Properties > User Emails) ; This way the user email will be generated only if the "if condition" is met.
The administrator has disabled public write access.

Re: Send conditional email user 12 years 6 months ago #19310

  • betrained
  • betrained's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 1
Thanks. The code works perfectly. However if I have 2 values inside that checkbox, for instance "Tarif" & "newsletter", I would like to send that user email just when the "tarif" value is checked and not "newsletter". If it is "newsletter" then I would like to copy Email & names value in RSMAIL to add a news user.
Last Edit: 12 years 6 months ago by betrained.
The administrator has disabled public write access.

Re: Send conditional email user 12 years 6 months ago #19313

  • betrained
  • betrained's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 1
I tryed that code but does not work too :

if(!empty($_POST=="TARIFS"))
{
$userEmail=$_POST;
}
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!