[SOLVED] Email form

2 years 2 months ago - 2 years 2 months ago #327763 by galanopd
Replied by galanopd on topic Email form
Yes Kyle, that worked.
Much probably I had turned it off by mistake.

Thank you
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

2 years 2 months ago - 2 years 2 months ago #327800 by galanopd
Replied by galanopd on topic Email form
Using the PHP auto action I am trying to bring the value and the label to the email body so I am trying to use something like this
$variables['var7'] = '[var7] [cb:parse function="clean" method="string"][if(isset($_POST['emailoptions']))
	{
		echo 'Email Options:<br />';
		echo '<br />Description: '.$_POST['label'];
		echo '<br />Indicator: '.$_POST['value'];
		exit;
	}][/cb:parse]';

or something like
$variables['var7'] = '[var7] [cb:parse function="clean" method="string"][post_emailoptions; foreach ($options as $value => $label) {
    echo '<option value="' . $value . '"' . ($value == $selected ? ' selected' : '') .  '>' . $label . '</option>';}][/cb:parse]';
but I can't make it work. I could put the label inside value=" " which could solve my problem but I am trying to understand how I could do it alternatively.

Thank you

Please Log in to join the conversation.

2 years 2 months ago #327812 by krileon
Replied by krileon on topic Email form
You need to write valid PHP. Neither of your examples are valid PHP. You can access POST data using [post_INPUTNAME] so you don't need to access it directly and please sanitize post data using the clean format function.

var7 is used to modify the email message to append or prepend additional information. I'm not sure why you're trying to render a <option> there, but it's not going to do anything. If you need the label of a <option> from your form then you need to convert [post_emailoptions] to the label in your code as the form does not send the label as part of the POST data.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: galanopd

Please Log in to join the conversation.

2 years 2 months ago #327821 by galanopd
Replied by galanopd on topic Email form
I understand Kyle, it seems a bit harder than expected.
I will study a bit more on how to implement this properly.

Please Log in to join the conversation.

2 years 2 months ago #327830 by krileon
Replied by krileon on topic Email form
It might be worth using a form extension so you can make whatever contact form style you need. Aside from that I can try providing some further examples when I'm back to work on monday (I don't work weekends). Looks like you're just wanting to convert the value of the select input to the label and append that to the email. Is that correct?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 2 months ago - 2 years 2 months ago #327837 by galanopd
Replied by galanopd on topic Email form
Yes Kyle and thank you for your answer.

Looks like you're just wanting to convert the value of the select input to the label and append that to the email. Is that correct?

Yes, that is correct and it will be used in both cases described when the user receives an email.
This message contains confidential information
Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.216 seconds

Facebook Twitter LinkedIn