• 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: variable text in email depending on radio button

variable text in email depending on radio button 11 years 1 month ago #26873

  • jeroen7
  • jeroen7's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi all,

I'm trying to put variable text in my confirmation email. This is depending on the choice a user makes by clicking on a radiobutton.

For example I have two Stuff radiobuttons:

O Bring stuff
O Send stuff

In my confirmation email I should think I can markup this:

{if {Radio_stuff:value}=='Send stuff'}
then show text X.
{/if}

And if value is:

{if {Radio_stuff:value}=='Bring stuff'}
then show text Y
{/if}

Is this achievable?
I can't get it to work

Thanks for commenting
The administrator has disabled public write access.

variable text in email depending on radio button 11 years 1 month ago #26878

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

The pseudo-code you are using only checks if the field does have a value and not which value it actually has, this is useful to not display a part of your email message if the field was left empty.

In your case, you can try implementing this via RSForm!Pro PHP Emails Scripts area(backend > Components > RSForm!Pro > Manage Forms > your form > Properties > PHP Email Scripts). I will provide an example for the User Email:
$modUserEmailText = $form->UserEmailText;
 
if($_POST['form']['Radio_stuff'] == 'Send stuff'){
$modUserEmailText = 'This is the first text';
}
 
elseif($_POST['form']['Radio_stuff'] == 'Bring stuff'){
$modUserEmailText = 'This is another text';
}
 
$userEmail['text'] = $modUserEmailText;
$userEmail['text'] = str_replace($placeholders, $values, $userEmail['text']);

More information on RSForm!Pro PHP Email Scripts area can be found here:

www.rsjoomla.com/support/documentation/v...p-email-scripts.html

How to correctly setup User/Admin emails is explained in the following article:

www.rsjoomla.com/support/documentation/v...ticle/74-emails.html
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!