How to show the ID in the Email result

Questions and bug reports for current release of CKForms

How to show the ID in the Email result

Postby jhawtin » Sun Aug 22, 2010 11:34 pm

I am re-writing my post with another title as I thought this one was clearer.

I have seen a few posts that are kind of related to this but not right on.

I need a way to reference the ID's of my fields in my email result. I want to do this for multiple fields.

Is there a piece of code that I can integrate into the html that will allow me to reference a field.

Example:

Dear {ID=1},

The "ID=1" here should translate into the name that was typed in on the form.

Please let me know if this is possible, or if there is a work around I can integrate to gain this functionality.

thanks!

Jaclyn 8-)
jhawtin
 
Posts: 2
Joined: Sun Aug 22, 2010 6:30 am
Top

Re: How to show the ID in the Email result

Postby jclins » Wed Aug 25, 2010 8:43 pm

hi I create a hack to ckforms (I don't know if the best choise, but.. worked for me):

edit \components\com_ckforms\models\ckforms.php

before tag (for me line 411 - ckforms 1.3.5 build 1):
Code: Select all
      /* ************************* */
      /*     Send Email Result     */
      /* ************************* */

put:
Code: Select all
      /* ************************* */
      /* ****Get email ID      *** */
      /* ************************* */
         $tn = "#__ckforms_".$ckform->id;
         $query = "SELECT id from ".$tn." order by id desc limit 1 ";
         $dbid =& JFactory::getDBO();
         $dbid->setQuery($query);
         $pegaid= $dbid ->loadResult();
      /* ************************* */


now go to line 494
Code: Select all
$mail->setSubject( $ckform->subject );


I change to:
Code: Select all
$mail->setSubject( $ckform->subject." id=".$ckform->id.".$pegaid );


regards
jclins
 
Posts: 1
Joined: Wed Aug 25, 2010 8:14 pm
Top


Return to CKForms 1.3.x Support forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron