• 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: PHP Add Variable Data to Email based on Conditions

PHP Add Variable Data to Email based on Conditions 9 years 9 months ago #31787

  • josh.thomson
  • josh.thomson's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 2
I have a form which asks various questions to the user...

The end result is that an email is sent to them containing a PHP script that is modified depending on their options selected.

However, I have stumbled into a wall... I can't seem to modify the form variables with my own code to hopefully get the modified result via email..

How do I update form variables in the PHP EMail Scripts/userEmail section?

Since the code used is private I can only provide a loose example:
 
if($_POST['form']['q1'] == 'Yup'){
$_POST['form']['q1'] = 'Give this man a cookie!';
}else{
$_POST['form']['q1'] = '';
}
 

Notes: The form contains a couple radio options, one has the value 'Yup' and the other is 'Nop'.

So in the email text I have a section that says:

Lorem ipsem: {q1:value}.


I can't seem to modify the {q1:value} so that it prints 'Give this man a cookie!'.

Please can you help.

Thanks,
Josh.

p.s. I can't seem to find documentation for adding custom PHP into RSForms. I can only find the odd example. If you could link me to it (if one exists), that would be great!
The administrator has disabled public write access.

PHP Add Variable Data to Email based on Conditions 9 years 9 months ago #31795

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
Have you tried using the value|label functionality available for dropdowns/radios/checkboxes?

www.rsjoomla.com/support/documentation/v...829-radio-group.html

If this is not the case, you can find additional information on PHP scripts here:

www.rsjoomla.com/support/documentation/r...ted/php-scripts.html
www.rsjoomla.com/support/documentation/r...p-email-scripts.html
www.rsjoomla.com/support/documentation/r...custom-php-code.html
My help is not official customer support. To receive your support, submit a ticket by clicking 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!