I have this working in v3 and am now trying to get it working in v4 (which is awesome by the way), after i upgraded the whole site to J2.5.
My apologies in advance if I missed a post on this. I did a search for this in the forums and came up with nothing, please redirect me if I missed it.
In v3 i had this in the "On Submit code - before sending email:"
and then this in the email: (in html mode)
How do I accomplish the same thing, receiving the cf_id from the table that the form populated with its contents, in the email sent by the form? Thanks for any help.
My apologies in advance if I missed a post on this. I did a search for this in the forums and came up with nothing, please redirect me if I missed it.
In v3 i had this in the "On Submit code - before sending email:"
<?php
$MyForm =& CFChronoForm::getInstance('FORM NAME');
$cf_id = $MyForm->tablerow['FORM ROW']->cf_id;
echo $cf_id;
JRequest::setVar('cf_id', $cf_id);
?>
and then this in the email: (in html mode)
CF_ID -<?php
$MyForm =& CFChronoForm::getInstance('FORM NAME');
$cf_id = $MyForm->tablerow['FORM ROW']->cf_id;
echo $cf_id;
?>
How do I accomplish the same thing, receiving the cf_id from the table that the form populated with its contents, in the email sent by the form? Thanks for any help.
OK, I see the potential problem with the cf_id, the email it is included in is being sent to us(admin) then used in a php script to pull data from the form into a webpage. So, using the cf_id as opposed to the cf_uid seems better to me as there is a chance, even though it is slight, that we could repeat numbers.
In any case, even if I do go with using the cf_uid, I still need some instruction on accomplishing this task in CFv4.
I see how the Custom Code Action is used in the model_id instance, can I use this in my case...to pull the cf_id or cf_uid?
I grabbed this from this post: http://www.chronoengine.com/forums.html?cont=posts&f=5&t=23068&p=75798&hilit=include+db+field+in+email#p75798
Will i need to specify the table as i did with CFv3?
In any case, even if I do go with using the cf_uid, I still need some instruction on accomplishing this task in CFv4.
I see how the Custom Code Action is used in the model_id instance, can I use this in my case...to pull the cf_id or cf_uid?
<?php
$form->data['some_name'] = $form->data['chronoform_data']['input_name'];
?>
I grabbed this from this post: http://www.chronoengine.com/forums.html?cont=posts&f=5&t=23068&p=75798&hilit=include+db+field+in+email#p75798
Will i need to specify the table as i did with CFv3?
Hi Riceman,
The code you need is in the FAQ, at least I think it is. Did you try it?
Bob
The code you need is in the FAQ, at least I think it is. Did you try it?
Bob
Thanks GreyHead...i think i found the answer and will test tomorrow. I'll post back either way.
CFv4 is awesome!
CFv4 is awesome!
Well, no luck so far.
Here is the code I am using, but it does not specify the table, which it used to do in CFv3. Obviously I am missing something.
This is a Custom Code Action ...after the DB Save Action, and before the Email Action.
Then this in the Email:
CF_ID {cf_id}
Here is the code I am using, but it does not specify the table, which it used to do in CFv3. Obviously I am missing something.
This is a Custom Code Action ...after the DB Save Action, and before the Email Action.
<?php
$form->data['cf_id'] = {$form->data['cf_id']} ;
?>
Then this in the Email:
CF_ID {cf_id}
A little digging on Google and I found it. "cf_id" in the search tab above strips the underscore, so its tough to search for this one here. But alas, i found the answer here!
http://www.chronoengine.com/forums.html?cont=posts&f=26&t=21470
So simple!!
Add this code in your Email Action, under the "Template Tab" and don't use the "editor":
http://www.chronoengine.com/forums.html?cont=posts&f=26&t=21470
So simple!!
Add this code in your Email Action, under the "Template Tab" and don't use the "editor":
<?php
$data = $form->data['chronoform_data'];
echo "the id is ".$data['cf_id'];
?>
Thanks GreyHead,
Right, the issue I was having with the FAQ is I didn't understand that the code their could go in the email, I was still under the impression I would need it in two places like CFv3. Probably my lack of understanding php/mysql.
So I thought I would spell it out for others like myself here in the post.
I'll use the other search from this point forward.
Right, the issue I was having with the FAQ is I didn't understand that the code their could go in the email, I was still under the impression I would need it in two places like CFv3. Probably my lack of understanding php/mysql.
So I thought I would spell it out for others like myself here in the post.
I'll use the other search from this point forward.
This topic is locked and no more replies can be posted.