Advancedform - reference number
Moderator: Tata
Advancedform - reference number
Hi foks,
I'm using the advancedforms plugin and i wonder if it is possible that, when somebody fill in a form, it generates a referencenumber that is send to the one who fill in the form and the webmaster.
By the way,... is it possible that the one who fill in the form gets a copy per mail?
Thanks in advance
I'm using the advancedforms plugin and i wonder if it is possible that, when somebody fill in a form, it generates a referencenumber that is send to the one who fill in the form and the webmaster.
By the way,... is it possible that the one who fill in the form gets a copy per mail?
Thanks in advance
Re: Advancedform - reference number
Let's start with the simple question: that happens automatically, if no "thanks page" is defined. If a "thanks page" is defined, the user would have to copy&paste its contents to somewhere (or print it out). See also https://github.com/cmb69/advancedform_x ... /README.md; search for "confirmation" on that page.
That should be doable, if you don't need a "thanks page" (otherwise there is no confirmation mail). Probably the biggest issue is how this reference number can be generated; is it just about some arbitrary number? Does it even have to be a real number, or would some random string (say, hexdecimal, e.g. 1f56ab) suffice? That could be done via a mailform hook; I think I could come up with something.
Even simpler, if feasible, would be to add a text field to the form, and let users fill that out with a reference number chosen by themselves.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Advancedform - reference number
Thanks Christoph for your input, much appreciated!
I don't need a thankpage, an e-mail to the one who filled in the form is okay. My excuses... i never took time to read the manual regarding thankpage/thank e-mail, so that's 'new' for me Great!!
A random string will do, as long as it is in the mail to the admin and to the sender.
Maybe this function would be handy for everyone? Just an extra option?
I don't need a thankpage, an e-mail to the one who filled in the form is okay. My excuses... i never took time to read the manual regarding thankpage/thank e-mail, so that's 'new' for me Great!!
A random string will do, as long as it is in the mail to the admin and to the sender.
Maybe this function would be handy for everyone? Just an extra option?
Re: Advancedform - reference number
I use "time" for this purpose.
In a different context, but that would certainly work for it too.
The result is a field with i.e. "1667383617" as content.
Create a field in the form (myform), with time.
"field": "time",
"label": "time",
"type: hidden,
The rest per hook
In the directory "data" of the plugin create a file myform.inc with the following content:
In a different context, but that would certainly work for it too.
The result is a field with i.e. "1667383617" as content.
Create a field in the form (myform), with time.
"field": "time",
"label": "time",
"type: hidden,
The rest per hook
In the directory "data" of the plugin create a file myform.inc with the following content:
Code: Select all
<?php
if (!function_exists('advfrm_custom_field_default')) {
function advfrm_custom_field_default($form_name, $field_name, $opt, $is_resent) {
if ($field_name == 'time') {
if (empty($_POST['advfrm-' . $field_name])) {
return time();
} else {
return $_POST['advfrm-' . $field_name];
}
}
}
}
Gruß Olaf, Plugins for CMSimple_XH
Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.
Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.
Re: Advancedform - reference number
Oh, that's nifty! That only has a resolution of 1 second, but that might be sufficient. If not, instead of time() you could use uniqid(), or even bin2hex(random_bytes(16)).
Are hidden fields sent to the form submitter? If not, just use a regular "text" field.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Advancedform - reference number
I do not know whether the sender would receive them.
As the recipient, you also get the hidden fields.
Gruß Olaf, Plugins for CMSimple_XH
Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.
Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.
Re: Advancedform - reference number
Thanks thanks !
Great idea and i'm gonna try things out. Will get back here with some feedback.
Thanks folks!
Great idea and i'm gonna try things out. Will get back here with some feedback.
Thanks folks!
Re: Advancedform - reference number
how hard i do try.... the sender does not get a copy per e-mail.
No, i don't use the 'thanks' page...??
No, i don't use the 'thanks' page...??
Re: Advancedform - reference number
help.htm wrote:After successful submission of the form, an email will be sent to the receivers (To, CC and BCC) specified in the form editor. Then the sent information is displayed to the visitors as confirmation, or, if a thanks page is specified, the visitors will be redirected there, and a confirmation mail will be sent to them. The thanks page/confirmation feature will only work, if a required field of type Sender (e-mail) is specified for the form, and Mail → Confirmation is enabled in the configuration.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“ Ludwig's XH-Templates for MultiPage & OnePage
Re: Advancedform - reference number
Thanks!!
Now the mail is receive!! (i thought the thankpage should not be use)... anyway.....
I got it work and the webmaster is receiving an email with the 'time' field', but the sender does not receive that information in his mail
Now the mail is receive!! (i thought the thankpage should not be use)... anyway.....
I got it work and the webmaster is receiving an email with the 'time' field', but the sender does not receive that information in his mail