Email Template and Profile Plugin

MuzikBraud05 10 Feb, 2009
Hello!

I'm almost done with this website, I just can't seem to get the profile plugin to work for the email template. I got the fields I wanted from jos_comprofiler to show up on the form(from Community Builder profile), but when the form is submitted, those fields aren't included in the e-mail. I tried adding {fieldname} to the top of the email template code, but it just displays "{fieldname}" with the brackets and everything instead of actually pulling the information. Here is the code from the Form HTML:

<style type="text/css">
.chronoform a{
color:#fff;
}
</style>
<?php
$user = JFactory::getUser();
?>
<?php echo $user->name; ?></br>
<?php echo $user->email; ?></br>
{phone}</br>
{cb_companybuilding}</br>
<DIV class=form_item   >
<DIV class=clear > </DIV></DIV>
<DIV class=form_item   >
<DIV class="form_element cf_datetimepicker" ><LABEL class=cf_label >Date for Service</LABEL><INPUT class="cf_datetime required" id=date_1  name=date_1   onClick="new Calendar(this);"></DIV>
<DIV class=clear > </DIV></DIV>
<DIV class=form_item   >
<DIV class="form_element cf_textbox" ><LABEL class=cf_label >Time for Service</LABEL><INPUT class="cf_inputbox required" id=text_2  maxLength=150 size=30 name=text_2 ></DIV>
<DIV class=clear > </DIV></DIV>
<DIV class=form_item   >
<DIV class="form_element cf_dropdown" ><LABEL class=cf_label >Service Requested</LABEL><SELECT class="cf_inputbox validate-selection" style='width:180px;' id=select_6 size=1 name=select_6 ><OPTION value="Select a service" selected >Select a service</OPTION><OPTION value="Laundry" >Laundry</OPTION><<OPTION value="Shoe Repair" >Shoe Repair</OPTION><OPTION value="Watch/Jewelry Repair" >Watch/Jewelry Repair</OPTION><OPTION value=Errand >Errand</OPTION><OPTION value="Post Office" >Post Office</OPTION><OPTION value="Personal Shopping" >Personal Shopping</OPTION><OPTION value=Flowers >Flowers</OPTION><OPTION value="Gift Basket" >Gift Basket</OPTION><OPTION value="Events Tickets" >Events Tickets</OPTION><OPTION value="Discount Movie Tickets" >Discount Movie Tickets</OPTION><OPTION value=Other >Other</OPTION></SELECT></DIV>
<DIV class=clear > </DIV></DIV>
<DIV class=form_item   >
<DIV class="form_element cf_textarea" ><LABEL class=cf_label >Notes/Special Instructions</LABEL><TEXTAREA class=cf_inputbox id=text_5 name=text_5 rows=3 cols=30 ></TEXTAREA></DIV>
<DIV class=clear > </DIV></DIV>
<DIV class=form_item   >
<DIV class="form_element cf_button" ><INPUT  type=submit value=Submit ></DIV>
<DIV class=clear > </DIV></DIV>


... and like I said, the form looks fine. Here is the code from the Email template tab:

<?php
$user = JFactory::getUser();
?>
<?php echo $user->name; ?></br>
<?php echo $user->email; ?></br>
{phone}</br>
{cb_companybuilding}</br>
<DIV class=form_item>
<DIV class=clear> </DIV></DIV>
<DIV class=form_item>
<DIV class="form_element cf_datetimepicker"><LABEL class=cf_label>Date for Service</LABEL><SPAN> {date_1}</SPAN></DIV>
<DIV class=clear> </DIV></DIV>
<DIV class=form_item>
<DIV class="form_element cf_textbox"><LABEL class=cf_label>Time for Service</LABEL><SPAN> {text_2}</SPAN></DIV>
<DIV class=clear> </DIV></DIV>
<DIV class=form_item>
<DIV class="form_element cf_dropdown"><LABEL class=cf_label>Service Requested</LABEL><SPAN> {select_6}</SPAN></DIV>
<DIV class=clear> </DIV></DIV>
<DIV class=form_item>
<DIV class="form_element cf_textarea"><LABEL class=cf_label>Notes/Special Instructions</LABEL><SPAN> {text_5}</SPAN></DIV>
<DIV class=clear> </DIV></DIV>
<DIV class=form_item>
<DIV class="form_element cf_button"></DIV>
<DIV class=clear> </DIV></DIV>


When I get the e-mail from the form, it looks like this:

Bobbi Watkins [email]xxxxxxx@gmail.com[/email] {phone} {cb_companybuilding}

Date for Service 02/12/2009

Time for Service 12:00pm

Service Requested Laundry

Notes/Special Instructions No bleach please.



Any help would be appreciated, I don't know much about PHP or anything, I've figured most of this out by looking at the forums and other people's post. Just tell me what code to put in and where to put it and I can do it :-) Thanks!
GreyHead 10 Feb, 2009
Hi MuzikBraud05,

There may be a better answer but I think this will work . . . add hidden fields to your form like
<input name='phone' type='hidden' value='{phone}' />
and they should carry the values through for you.

Bob
MuzikBraud05 19 Mar, 2009
Just realized I never said thank you! This worked just fine, thank you for your quick reply!
bman 20 Apr, 2009
THANKS. Solved my exact problem.
This topic is locked and no more replies can be posted.