Buy Now
Sign in

DB Record in Email (Chronoforms V6)

gunjah , July 29 2017
G
gunjah
Dear friends

How can I input a db record in email body?

I'm referring to a record of the main form database (where the form saves its data).

Example: My db record I'm interested in, is the "aid", that is the unique number of every record.

I use the SAVE DATA in SUBMIT, and the form is correctly saved in the database.

I can't seem to find a way to input this record data in email body, nor in the on screen message, after the form submission.

Any ideas?

p.s. After CF5 I didn't think that the software could be better, but you did it again. CF6 is awesome! I wonder why joomla community hasn't given the right acknowledgment.
GreyHead
Hi gunjah,

I think that CFv6 adds the record ID to the form data after the DB Save - if you add a Debugger action to your form you should be able to identify the variable name that is used and add that to the Email template.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
G
gunjah
Hi GreyHead

Thank toy for your extra fast reply.

This is the debug:

Array
(
[validate_fields2] => Array
(
[log] => Automatic validation enabled.
[var] => 1
)

[save_data12] => Array
(
[data] => Array
(
[created] => 2017-07-29 08:30:48
[user_id] => 530
[aid] =>
[text1] => aaaa
)

[_success] => Data saved successfully
[log] => Array
(
[0] => INSERT INTO `azh9g_chronoengine_chronoforms_data_τεστ` (`created`, `user_id`, `text1`) values ('2017-07-29 08:30:48', '530', 'aaaa');
)

[var] => Array
(
[created] => 2017-07-29 08:30:48
[user_id] => 530
[text1] => aaaa
)

)


Can you tell me the exact syntax of the email. I tried many ({aid}, {data:aid}, {session:aid}) but no luck.

Thank you
GreyHead
Hi gunjah,

I would have expected the array at the end of the Debugger output to have included the new record ID / 'aid' - perhaps Max hasn't included that in CFv6 :-(

Please ask him directly using the Contact Us menu above and linking to this thread.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
admin
Hi,

v6 is a bit different here, any action result is available under the var matching the action's name, as per the debug, you can get the aid value with this shortcode: {var:save_data12.data.aid}

You can use this shortcode anywhere after the save data has run.

But actually it looks like you have a problem with the aid auto increment ? because its empty.

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
G
gunjah
Hi guys

Thank you for your answers.

1. Maybe it looks that the aid auto increment has a problem, but in the actual table of the database is fine. No problem there.

2. As for the main question, since I'm a real newbie, can you please write the exact things for every action? (read data, email, and maybe save to session, if needed)

Thanks again

mik
admin
Hi mik,

it should be {var:save_data12.aid} in your case but it will return empty result according to your debug data.

Could you please post a screenshot of your form setup ?

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
G
gunjah
Ok, keep in mind, that this is just a test form (with only a text field and a submit button).
Attachments
form01.jpg
form01.jpg
(162.02 KiB)
407 Downloads/Views
form02.jpg
form02.jpg
(211.43 KiB)
409 Downloads/Views
form03.jpg
form03.jpg
(155.4 KiB)
389 Downloads/Views
form04.jpg
form04.jpg
(143.13 KiB)
409 Downloads/Views
admin
Hi gunjah,

The code should be {var:save_data12.aid}

Your setup looks ok, but the table name is has some non latin characters, could you please try with an english table name ?

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
G
gunjah
Hi Max

I changed the name of the table. Now it has only latin chars. I set it in save data action so it will save in this table now.
Here my new debug:

[save_data12] => Array
(
[data] => Array
(
[option] => com_chronoforms6
[cont] => manager
[chronoform] => τεστ
[event] => submit
[text1] => ffffff
[button2] =>
[ff4bee3fb6c90ae947de28a5e347feaf] => 34b03e09e73f27ceae17026068884f7e
[_ga] => GA1.2.1234725927.1501220774
[_gid] => GA1.2.613207738.1501652447
[c1a37326484447a99d3ce08357fc23f2] => 45fec96ea2a4776a0230eb4fc740de49
[created] => 2017-08-02 05:44:32
[user_id] => 530
[aid] =>
)

[_success] => Data saved successfully
[log] => Array
(
[0] => INSERT INTO `azh9g_chronoengine_chronoforms_data_test` (`text1`, `created`, `user_id`, `aid`) values ('ffffff', '2017-08-02 05:44:32', '530', '');
)

[var] => Array
(
[text1] => ffffff
[created] => 2017-08-02 05:44:32
[user_id] => 530
[aid] => 2
)

)


So now what should I enter in actions (save data, read data and email)?

Regards

mik
admin
Hi mik,

Now the following shortcode should work: {var:save_data12.aid}

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
G
gunjah
Dear Max

Thank you very much! It worked like a charm!

Regards

mik
G
gunjah
Dear Max

Sorry to bother you again, but a strange symptom appeared in my forms. I can see the full form in the backend, but only 7 fields in the front end.

Any ideas?
G
gunjah
Dear Max

I believe it is subscription issue.

So now I'm buying the 35$ (5 sites) subscription, via another account.

If I validate it and everything is normal again, then ok. If it is another, bigger, issue, I'll contact you.

regards

mik
GreyHead
Hi mik,

I believe that Max has changed the latest release of CFv6 to limit the number of inputs that are displayed in the 'free' version. As you have found, validating the site will remove this limit.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
S
skalounas
Yes, I did already.
I thank you both for your great support.

1. By the way, the 5 sites subscription, gives me the right to post more questions in forums?
2. I'm in a negociation with a client about buying the unlimited validation package, but 200$ is a bit too much. If it was something like 100-120 we would definitely buy it. Think about it and tell me.

Best regards

mik
GreyHead
Hi mik,

There is no limit on questions in the forums. Pricing is all up to Max, not me . . .

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
Д
Джахан
hi Admin. Where I should put this part of code: {var:save_data12.data.aid}?