Forums

Populate cf_id and print it in mail

epsdaniel 06 Mar, 2012
Dear Bob,

I really need help with this matter.

I have a form that save data on a table. I need to get cf_id and print it in email that user will receive. I have tried some codes found on the forum but not success.

Could you please show me how to get {cf_id} just before send the mail and print on sent mails?

I need a unique number of every form sent / data record. I think the best way just to avoid any problem is populate and use cf_id.

Thanks so much,

Daniel
GreyHead 06 Mar, 2012
Hi Daniel,

Is this ChronoForms v4? Then I suggest that you use my Unique ID action and forget about cf_id. Get it here. You can be done in five minutes.

Bob
epsdaniel 07 Mar, 2012
Dear Bob,

Great! everything done it and working like a charm!

I really thank you!!

Daniel
tyler779 24 Apr, 2012
but if we need a progressive number, like the cf_id?
would be great to add an option on that form.

on version 3 i was using this form to give a progressive number to contracts:
http://www.italms.it/index.php?option=com_chronocontact&chronoformname=numero_progressivo
and as result i get a number like:

2012-1171 where 2012 was the year, and 1171 the cf_id number.

but on version 4 is not possible to use that code and frackly speacking I don't get why.

<div class="form_item">
  <div class="form_element cf_heading">
    <h1 class="cf_text">NUMERO PROGRESSIVO ASSEGNATO:</h1>
  </div>
  <div class="clear"> </div>
2012-<?
    $MyForm =& CFChronoForm::getInstance('numero_progressivo');
    $cf_id = $MyForm->tablerow['jos_chronoforms_numero_progressivo']->cf_id;
    echo $cf_id;
    ?>
     - {cliente} - {tipoofferta}
<div>
    La richiesta è stata registrata a nome: {richiedente} {email}
<div class="form_item">
  <div class="form_element cf_button">
GreyHead 24 Apr, 2012
Hi tyler779,

You can still access the cf_id it's just that the code has changed in CFv4. Please try replacing
    $MyForm =& CFChronoForm::getInstance('numero_progressivo');
    $cf_id = $MyForm->tablerow['jos_chronoforms_numero_progressivo']->cf_id;
with

    $cf_id = $form->data['chronoform_data_cf_id'];
NB If you are using a Model ID then replace 'chronoform_data' with the Model ID, if in doubt use a Debugger action to show you the contents of the $form->data array.

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

VPS & Email Hosting 20% discount
hostinger