Hello,
i need to set a string to put in the email that i send to the user, depending on the choice that he do in a dropdown list. How can i do that?
thanks in advance and regards
please tell us more info, you want a different text for each option or something else ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Yes, i have a dropdown list with three choices, the structure is "course code", "course description"; in the email, that i send to users who compile the form, i need to put the price of the course choosed. So what i need is associate a small string (a number actually) to each line of dropdown list, and use it in the email
Hi tamerlano,
You can use a Custom Code action before the email action to look at the submitted data and add the appropriate prices to the form data for display.
Bob
Hi Bob,
thanks, but i have no enough skill to do that, do you have perhaps an example code?
Done! In Custom Code after On submit i put this code:
<?php if ($form->data['corso'] == 'aaa') {$form->data['totalPrice'] = 1;} elseif ($form->data['corso'] == 'bbb') {$form->data['totalPrice'] = 2;}
else {$form->data['totalPrice'] = 3;}
?>
and then i put {totalPrice} in my email. It works, thanks you very much.
This feature is available in v7 as "Server options" for the "Dropdown" field, you will be able to set a list of values to get from the dropdown apart from the real options values, the values will be under {var:dropdown_name}
But at the moment v7 is still in Beta state and its not recommended to use it for production!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.