Hi, Grey head
I'm trying to send a different E-mail based on the choice of the radio buttons made by a user.However, As per the technique that i'm using i only want a phrase change in the email template according to the value of the choice made.
I'm relatively new to Chronoforms and PHP scripting. Following is the HTML code of the Form I'm using:
<link href="http://blueboxglobal.com/blueboxglobal/components/com_chronoforms/css/tooltip.css" rel="stylesheet" type="text/css" /><form action="http://blueboxglobal.com/blueboxglobal/index.php/internship-form?chronoform=Internship_Form&event=submit" name="Internship_Form" id="chronoform_Internship_Form" method="post" enctype="multipart/form-data" class="Chronoform"><div class="ccms_form_element cfdiv_header" id="autoID-a2166514a1f344506abcffb4a0df55bb_container_div"><p><legend style="padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; font-weight: bold; font-size: 16px; color: #333333; font-family: DroidSansRegular; line-height: 18px; background-color: #90c8e3;">Internship form</legend></p>
<ol id="rsform_6_page_0" class="formContainer" style="color: #333333; font-family: DroidSansRegular; font-size: 13px; line-height: 18px; background-color: #90c8e3; padding: 0px; margin: 0px;">
<li class="rsform-block rsform-block-intro-text" style="overflow-x: hidden; overflow-y: hidden; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ebf8ff; list-style-type: none; list-style-position: initial; list-style-image: initial; clear: both; background-position: initial initial; background-repeat: initial initial; padding: 5px; margin: 0px;">
<div class="formBody" style="float: left;">We appreciate your interest in wanting to be part of the Bluebox Internship Program. <br /><br />Congratulations, you have been shortlisted. There is just one more step before we invite you for an interview. Please fill out the web form below and click on the submit button. You will then be assigned an interview slot based on your preference. If you are not in Mumbai, we will schedule phone interviews/conference for you.</div>
</li>
</ol>
<p> </p><div class="clear"></div></div><div class="ccms_form_element cfdiv_radio radios_over" id="current_opening_container_div"><label for="Current Opening">Current Openings (Pick one from here and one from the list below, if you qualify)</label><div style="float:left; clear:none;"><input type="radio" name="Current_Opening" id="current_opening_business_development_manager" title="Current Opening" value="Business Development Manager" class="" />
<label for="current_opening_business_development_manager">Business Development Manager</label>
<input type="radio" name="Current_Opening" id="current_opening_content_writer" title="Current Opening" value="Content Writer" class="" />
<label for="current_opening_content_writer">Content Writer</label>
<input type="radio" name="Current_Opening" id="current_opening_front_end_developer_ux_designer" title="Current Opening" value="Front End Developer UX Designer" class="" />
<label for="current_opening_front_end_developer_ux_designer">Front End Developer UX Designer</label>
<input type="radio" name="Current_Opening" id="current_opening_linux_server_mail_sever_administrator" title="Current Opening" value="Linux Server/Mail Sever Administrator" class="" />
<label for="current_opening_linux_server_mail_sever_administrator">Linux Server/Mail Sever Administrator</label>
<input type="radio" name="Current_Opening" id="current_opening_executive_assistant_to_the_ceo" title="Current Opening" value="Executive Assistant to the CEO" class="" />
<label for="current_opening_executive_assistant_to_the_ceo">Executive Assistant to the CEO</label>
</div><div title="Current Openings (Pick one from here and one from the list below, if you qualify)" rel="Pick one from here and one from the list below, if you qualify" class="tooltipimg"><a href="#">?</a></div><div class="clear"></div><div id="error-message-Current_Opening"></div></div><div class="ccms_form_element cfdiv_radio radios_over" id="additional_options_container_div"><label for="Additional options">Additional options for CA, CS, CWA, LLB, CFA, PhD and MBA (and other post advanced degree holders ONLY)</label><input type="hidden" name="Additional_Options" value="" alt="ghost" />
<div style="float:left; clear:none;"><input type="radio" name="Additional_Options" id="additional_options_international_m_a" title="Additional options" value="International M&A " class="" />
<label for="additional_options_international_m_a">International M&A / Offshore Structuring & Investment Banking Associate</label>
<input type="radio" name="Additional_Options" id="additional_options_investment_banking_intern" title="Additional options" value="Investment Banking Intern" class="" />
<label for="additional_options_investment_banking_intern">Investment Banking Intern</label>
<input type="radio" name="Additional_Options" id="additional_options_consulting_intern" title="Additional options" value="Consulting Intern" class="" />
<label for="additional_options_consulting_intern">Consulting Intern</label>
<input type="radio" name="Additional_Options" id="additional_options_management_intern" title="Additional options" value="Management Intern" class="" />
<label for="additional_options_management_intern">Management Intern - Job Rotation in All Core Areas</label>
</div><div class="clear"></div><div id="error-message-Additional_Options"></div></div><div class="ccms_form_element cfdiv_text label_over" id="autoID-9a0606eda47fccd97eccd2e9e4711b09_container_div"><label>Where did you hear about the internship opportunity?</label><input maxlength="150" size="30" class=" validate['required','alphanum']" title="" type="text" value="" name="Internship_Info" />
<div class="clear"></div><div id="error-message-Internship_Info"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-3c67e7cad2606133c65f070f037d732b_container_div"><label>First Name</label><input maxlength="150" size="30" class=" validate['required','alpha']" title="" type="text" value="" name="First_Name" />
<div class="clear"></div><div id="error-message-First_Name"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-f13683e8be0908957f1fbddcf62a1ad2_container_div"><label>Last Name</label><input maxlength="150" size="30" class=" validate['required','alpha']" title="" type="text" value="" name="Last_Name" />
<div class="clear"></div><div id="error-message-Last_Name"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-8a8ce6157d30668da6969e5b5155958c_container_div"><label>Email</label><input maxlength="150" size="30" class=" validate['required','email']" title="" type="text" value="" name="Email" />
<div class="clear"></div><div id="error-message-Email"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-8f4132388d8d1dea956d54fdad5109c8_container_div"><label>Phone No.</label><input maxlength="150" size="30" class=" validate['required','phone']" title="" type="text" value="" name="Phone" />
<div class="clear"></div><div id="error-message-Phone"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-e28d9f2164bb76994af1436ce5f75e1e_container_div"><label>City you live in currently</label><input maxlength="150" size="30" class=" validate['alpha']" title="" type="text" value="Mumbai" name="City" />
<div class="clear"></div><div id="error-message-City"></div></div><div class="ccms_form_element cfdiv_radio" id="autoID-2917d265a6f2f5b3f44b4450fbd99e89_container_div"><label>Your computer</label><input type="hidden" name="Computer" value="" alt="ghost" />
<div style="float:left; clear:none;"><input type="radio" name="Computer" id="computer_laptop" title="" value="Laptop" class="validate['required']" />
<label for="computer_laptop">Laptop</label>
<input type="radio" name="Computer" id="computer_desktop" title="" value="Desktop" class="validate['required']" />
<label for="computer_desktop">Desktop</label>
<input type="radio" name="Computer" id="computer_both" title="" value="Both" class="validate['required']" />
<label for="computer_both">Both</label>
<input type="radio" name="Computer" id="computer_no" title="" value="No" class="validate['required']" />
<label for="computer_no">I don't have a computer</label>
</div><div class="clear"></div><div id="error-message-Computer"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-8f6989c2047bd4f4b9dc8d925a5ed585_container_div"><label>Name of College or University</label><input maxlength="150" size="30" class=" validate['required','alphanum']" title="" type="text" value="" name="College" />
<div class="clear"></div><div id="error-message-College"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-89d04d8b6f5bb9733e153b7973cb34df_container_div"><label>Degree</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="Degree" />
<div class="clear"></div><div id="error-message-Degree"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-bf42b51675e073c5f9f2c85e47f51e22_container_div"><label>Anticipated Graduation Date</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="Grad_Date" />
<div class="clear"></div><div id="error-message-Grad_Date"></div></div><div class="ccms_form_element cfdiv_select" id="autoID-49ba79aceeef3bc1619e5a8e59720500_container_div"><label>Internship Location</label><select size="1" class="" title="" name="Internship_Location">
<option value="Office" selected="selected">Office-I live in or around Mumbai.</option>
<option value="Home">Home - I do not live in or around Mumbai - I would like to work from home for this internship.</option>
<option value=""></option>
</select>
<div class="clear"></div><div id="error-message-Internship_Location"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-d37213eed1662acb635d6dcf85e52f91_container_div"><label>Internship Period</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="Internship_period" />
<div class="clear"></div><div id="error-message-Internship_period"></div></div><div class="ccms_form_element cfdiv_checkboxgroup radios_over" id="autoID-b008d0165bb4ee15e7dccea1b87f1537_container_div"><label>Availability</label><input type="hidden" name="Availability" value="" alt="ghost" />
<div style="float:left; clear:none;"><input type="checkbox" name="Availability[]" id="availability_monday" title="" value="Monday" class="validate['group[18]']" />
<label for="availability_monday">Monday</label>
<input type="checkbox" name="Availability[]" id="availability_tuesday" title="" value="Tuesday" class="validate['group[18]']" />
<label for="availability_tuesday">Tuesday</label>
<input type="checkbox" name="Availability[]" id="availability_wednesday" title="" value="Wednesday" class="validate['group[18]']" />
<label for="availability_wednesday">Wednesday</label>
<input type="checkbox" name="Availability[]" id="availability_thursday" title="" value="Thursday" class="validate['group[18]']" />
<label for="availability_thursday">Thursday</label>
<input type="checkbox" name="Availability[]" id="availability_friday" title="" value="Friday" class="validate['group[18]']" />
<label for="availability_friday">Friday</label>
<input type="checkbox" name="Availability[]" id="availability_saturday" title="" value="Saturday" class="validate['group[18]']" />
<label for="availability_saturday">Saturday</label>
<input type="checkbox" name="Availability[]" id="availability_sunday" title="" value="Sunday" class="validate['group[18]']" />
<label for="availability_sunday">Sunday</label>
</div><div class="small-message">Please select days that you are available for work, regardless of full time, part time or remote.</div><div class="clear"></div><div id="error-message-Availability"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-c3dcd682bccb7222dadaddc88949d821_container_div"><label>Ave hours per day</label><input maxlength="150" size="30" class="" title="" type="text" value="" name="Avg_hours_per_day" />
<div class="clear"></div><div id="error-message-Avg_hours_per_day"></div></div><div class="ccms_form_element cfdiv_file" id="autoID-6c7056cd2809dcdfd08be6c22e414f49_container_div"><label>Upload your resume</label><input type="hidden" name="File_Upload" value="" alt="ghost" />
<input class=" validate['required']" title="Upload your resume" type="file" name="File_Upload" />
<div class="clear"></div><div id="error-message-File_Upload"></div></div><div class="ccms_form_element cfdiv_header" id="autoID-d9feeba0a92c4692c9a7be0d786670e3_container_div"><p><br /><span style="color: #333333; font-family: DroidSansRegular; font-size: 13px; line-height: 18px; background-color: #ebf8ff;">DECLARATION: </span><br style="color: #333333; font-family: DroidSansRegular; font-size: 13px; line-height: 18px; background-color: #ebf8ff;" /><span style="color: #333333; font-family: DroidSansRegular; font-size: 13px; line-height: 18px; background-color: #ebf8ff;">I declare that all the information provided above are true to the best of my knowledge. </span><br style="color: #333333; font-family: DroidSansRegular; font-size: 13px; line-height: 18px; background-color: #ebf8ff;" /><span style="color: #333333; font-family: DroidSansRegular; font-size: 13px; line-height: 18px; background-color: #ebf8ff;">I promise that if I am awarded the internship, I will execute my assignments and duties to the best of my abilities. </span><br style="color: #333333; font-family: DroidSansRegular; font-size: 13px; line-height: 18px; background-color: #ebf8ff;" /><br style="color: #333333; font-family: DroidSansRegular; font-size: 13px; line-height: 18px; background-color: #ebf8ff;" /><span style="color: #333333; font-family: DroidSansRegular; font-size: 13px; line-height: 18px; background-color: #ebf8ff;">* Please note that while this is an unpaid Internship, we will consider requests for stipend on a case to case basis.</span></p><div class="clear"></div></div><div class="ccms_form_element cfdiv_checkbox" id="autoID-9e84c0af2beafe27d6769cef7b186839_container_div"><input type="hidden" name="Declaration" value="" alt="ghost" />
<input value="1" title="" type="checkbox" class="validate['required'] label_left" name="Declaration" id="declaration" />
<label for="declaration">Declaration</label><div class="small-message">I have read and agree to the above.<br />
</div><div class="clear"></div><div id="error-message-Declaration"></div></div><div class="ccms_form_element cfdiv_submit" id="autoID-cf5754fa87939f8a93f611703286873b_container_div"><input name="Submit" class="" value="Submit" type="submit" />
<input type='reset' name='reset' value='Reset' /><div class="clear"></div><div id="error-message-Submit"></div></div><input type="hidden" name="7db4150b194ef49a64bb06675c6fe4b0" value="1" /></form>
Based on the choice made in the Current_Opening radio button group i want to send a different link to each user.I've made A hidden field in the form and named it Link so that it takes the value of Link when the choice is made.
Following is the onSubmit-Before Code:
<?php
$radio = JRequest::getString('Current_Opening', '', 'post');
switch ( $radio ) {
case 'Business Development Manager':
JRequest::setVar('Link', 'http://blueboxglobal.com/blueboxglobal/index.php/citizenship');
break;
case 'Content Writer':
JRequest::setVar('Link', 'http://blueboxglobal.com/blueboxglobal/index.php/careers/content-writer-quiz');
break;
case 'Front End Developer UX Designer':
JRequest::setVar('Link', 'http://http://www.blueboxglobal.com/blueboxglobal/index.php/consulting');
break;
case 'Linux Server/Mail Sever Administrator':
JRequest::setVar('Link', 'http://http://www.blueboxglobal.com/blueboxglobal/index.php/our-firm');
break;
case 'Executive Assistant to the CEO':
default:
JRequest::setVar('Link', 'http://blueboxglobal.com/blueboxglobal/index.php/careers/content-writer-quiz');
break;
}
?>
The email Template is as follows:
<p>Dear {First_Name} {Last_Name} ,</p>
<p>Thank you! {First_Name} , For Exploring Internship Opputunities With Blueboxglobal. We have recieved your application for the post of {Current_Opening}. Before we call you for the interview we would like you to appear for the pre-interview screening test.</p>
<p>Since you have applied for the post of {Current_Opening} and/ or {Additional_Options}, Please click on the following link. Enter your login Credentials that you receive in the mail sent to you.</p>
<p>Test for {Current_Opening} : {Link} </p>
<p>Once you clear the test you will be Called for the Interview.</p>
<p>Thanks & Regards,</p>
<p>ADMIN,</p>
<p>Blueboxglobal Pte Ltd.</p>
However the link variable doesn't take any values and is blank always.
Please help me with the this. Will be very thankful.