send a copy check box

barnea10 10 May, 2011
hi
i would like to ask if there is a way to have the user decide if he want to recieve
a copy of his form filling.
thanks

barnea
GreyHead 10 May, 2011
Hi barnea,

Which version of ChronoForms are you using please?

Bob
barnea10 10 May, 2011
hi

its 3.1 RC5.5

thanks

barnea
barnea10 11 May, 2011
hi
i pasted the before submit code
no message was recieved.
not to the recipients and not as copy.

the form code :
<span class="cf_text">name</span><br /> <input id="text_1" class="cf_inputbox required" maxlength="152" name="text_1" size="31" type="text" />


<span class="cf_text">phone</span><br /> <input id="text_2" class="cf_inputbox" maxlength="152" name="text_2" size="31" type="text" />


<span class="cf_text">address</span><br /> <input id="text_3" class="cf_inputbox" maxlength="152" name="text_3" size="31" type="text" />


<span class="cf_text">email</span><br /> <input id="text_4" class="cf_inputbox required" maxlength="152" name="text_4" size="31" type="text" />


<span class="cf_text">subject</span><br /> <input id="text_5" class="cf_inputbox required" maxlength="152" name="text_5" size="31" type="text" />


<span class="cf_text">message</span><br /> <textarea id="text_6" class="cf_inputbox required" cols="24" rows="8" name="text_6"></textarea>


<div class="checkBox"><input name="check0" type="checkbox" value="" /> Email a copy of this message to your own address.
<div class="form_element cf_button"><input style="border: 0pt none; background: url(images/stories/sendbutton.png) no-repeat scroll 0% 0% transparent; color: #ffffff; padding: 10px 5px; font-size: 0px; display: block; height: 33px; width: 114px; cursor: pointer;" name="button_5" type="submit" /></div></div>


the before submit :
<?php
$MyForm =& CFChronoForm::getInstance("$formname");
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$copyme = JRequest::getVar('check0', array(), 'POST', 'array', 0);

if (in_array('Receive a copy of the message by e-mail.', $copyme))
{
  $MyFormEmails->setEmailData(2, 'enabled', '1');
}
?>



please advice
barnea
barnea10 11 May, 2011
i changed the form according to the ref. post :



<div class="form_item">
  <div class="form_element cf_textbox">
<span class="cf_text">ניתן להשאיר הודעה ונחזור אליכם בהקדם<br /></span>


<span class="cf_text">שם</span><br /> <input id="text_1" class="cf_inputbox required" maxlength="152" name="text_1" size="31" type="text" />
</div</div>


<div class="form_item">
  <div class="form_element cf_textbox">
<span class="cf_text">שם משפחה</span><br /> <input id="text_2" class="cf_inputbox" maxlength="152" name="text_2" size="31" type="text" />
</div></div>


<div class="form_item">
  <div class="form_element cf_textbox">
<span class="cf_text">כתובת</span><br /> <input id="text_3" class="cf_inputbox" maxlength="152" name="text_3" size="31" type="text" />
</div></div>


<div class="form_item">
  <div class="form_element cf_textbox">
<span class="cf_text">כתובת דוא"ל:</span><br /> <input id="text_4" class="cf_inputbox required" maxlength="152" name="text_4" size="31" type="text" />
</div</div>


<div class="form_item">
  <div class="form_element cf_textbox">
<span class="cf_text">נושא ההודעה:</span><br /> <input id="text_5" class="cf_inputbox required" maxlength="152" name="text_5" size="31" type="text" />
</div></div>


<div class="form_item">
  <div class="form_element cf_textarea">
<span class="cf_text">נא להזין את ההודעה:</span><br /> <textarea id="text_6" class="cf_inputbox required" cols="24" rows="8" name="text_6"></textarea>
</div></div>



<div class="form_item">
  <div class="form_element cf_checkbox">
    <label class="cf_label" style="display: none;"></label>
    <div class="float_left">
      <input value="Receive a copy of the message by e-mail." title="" class="radio" id="check00" name="check0[]" type="checkbox" />
      <label for="check00" class="check_label">Receive a copy of the message by e-mail.</label>
      <br />
     

    </div>
   
  </div>



<div class="form_element cf_button"><input style="border: 0pt none; background: url(images/stories/sendbutton.png) no-repeat scroll 0% 0% transparent; color: #ffffff; padding: 10px 5px; font-size: 0px; display: block; height: 33px; width: 114px; cursor: pointer;" name="button_5" type="submit" /></div></div>





and in the
On Submit code - before sending email

<?php
$MyForm =& CFChronoForm::getInstance("$formname");
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$copyme = JRequest::getVar('check0', array(), 'POST', 'array', 0);

if (in_array('Receive a copy of the message by e-mail.', $copyme))
{
  $MyFormEmails->setEmailData(2, 'enabled', '1');
}
?>



in the setup emails enabled email - yes

i get the mails but not the copy

please advice
GreyHead 13 May, 2011
Hi barnea10,

I copied your code into a new form and it appears to work OK.

The only change that I made was in this line
$MyFormEmails->setEmailData(2, 'enabled', '1');
I only had one Email Setup so this became
$MyFormEmails->setEmailData(1, 'enabled', '1');


Bob
barnea10 15 May, 2011
hi

i made this change but still, i dont get the copy.

see the definitions here attached - pls tell me if its ok

thanks

Barnea
GreyHead 26 May, 2011
Hi Barnea,

All this looks OK apart from the CC box. We know that if you ae using the PHP Mail Function mailer on your site it doesn't support CC or BCC. Try it without that entry.

Bob
This topic is locked and no more replies can be posted.