Hello, I have a form that sends and email with the data to the administrator and a "Thank you" email to the sender.
I am not saving anything into any database.
I just need to insert a random number/string within both emails so that the administrator will get something like this:
"A new user filled the form. His ID is 123abc"
and the sender will receive something like this:
"Thanks for your registration. Your registration number is 123abc"
I don't need a duplicate-number-check because the chance they will be the same would be very low.
The amount of number can be 6 or 10 or 12 or whatever. I have searched quite some time within the form but I did not find anything.
Thanks.
I am not saving anything into any database.
I just need to insert a random number/string within both emails so that the administrator will get something like this:
"A new user filled the form. His ID is 123abc"
and the sender will receive something like this:
"Thanks for your registration. Your registration number is 123abc"
I don't need a duplicate-number-check because the chance they will be the same would be very low.
The amount of number can be 6 or 10 or 12 or whatever. I have searched quite some time within the form but I did not find anything.
Thanks.
Hi dave18,
You can use a Custom Code action with a few lines of PHP to generate a random string - you can find plenty of examples with Google e.g. this StackOverFlow answer.
Bob
PS If you were saving to a database table I have a Unique ID [GH] action that will do the work for you.
You can use a Custom Code action with a few lines of PHP to generate a random string - you can find plenty of examples with Google e.g. this StackOverFlow answer.
Bob
PS If you were saving to a database table I have a Unique ID [GH] action that will do the work for you.
Hi Zyraj,
In v6 you can use {uuid:} or {rand:}
Best regards,
Max
In v6 you can use {uuid:} or {rand:}
Best regards,
Max
Hi Zyraj,
Which version of ChronoForms are you using? My action is for CFv5 only.
Bob
Which version of ChronoForms are you using? My action is for CFv5 only.
Bob
Hi, Max.
{uuid:} or {rand:} may be used to store a Real UniqueID into database?
Which one is better?
And how long is the string returned?
(CF6)
{uuid:} or {rand:} may be used to store a Real UniqueID into database?
Which one is better?
And how long is the string returned?
(CF6)
Hi indiana71,
I think that both of these will return quite long random strings - the uuid in CFv5 is 64 characters. And while they will almost certainly be unique there is no check for that.
If you want a short user friendly string then you can generate that in a custom action and check that it has not already been used.
Bob
I think that both of these will return quite long random strings - the uuid in CFv5 is 64 characters. And while they will almost certainly be unique there is no check for that.
If you want a short user friendly string then you can generate that in a custom action and check that it has not already been used.
Bob
This topic is locked and no more replies can be posted.
