Forums

DB Record in Email (Chronoforms V6)

gunjah 29 Jul, 2017
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 29 Jul, 2017
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
gunjah 29 Jul, 2017
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 29 Jul, 2017
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
Max_admin 30 Jul, 2017
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
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
gunjah 30 Jul, 2017
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
Max_admin 30 Jul, 2017
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
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
gunjah 30 Jul, 2017
Ok, keep in mind, that this is just a test form (with only a text field and a submit button).
Max_admin 01 Aug, 2017
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
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
gunjah 02 Aug, 2017
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
Max_admin 02 Aug, 2017
Hi mik,

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

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
gunjah 02 Aug, 2017
Dear Max

Thank you very much! It worked like a charm!

Regards

mik
gunjah 02 Aug, 2017
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?
gunjah 02 Aug, 2017
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 02 Aug, 2017
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
skalounas 02 Aug, 2017
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 02 Aug, 2017
Hi mik,

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

Bob
Джахан 06 Aug, 2018
hi Admin. Where I should put this part of code: {var:save_data12.data.aid}?
This topic is locked and no more replies can be posted.