PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Send Confirmation Number

  1. Saabana
    Member

    Hiya,
    I'm building a new web site for a Taxi Company
    Just I need the customer to have confirmation number send it by email
    please show me the way to do it.

    Posted 9 years ago on Friday March 11, 2011 | Permalink
  2. The only number that is generated by Gravity Forms is the Entry ID so you could use that.

    You would edit and configure the Notifications for that form. The Notifications are the emails that are sent. The User Notification is the email sent to the user. You can customize the message that is sent, and insert form field values.

    You could use the Entry ID form value and simply display it with text that calls it the Confirmation Number.

    Otherwise the only way to do a true unique confirmation number would be via custom code.

    Posted 9 years ago on Friday March 11, 2011 | Permalink
  3. paulzxz
    Member

    I am wanting to do this also but failing to populate a field with the Entry ID?

    What is the short code / how is it done?

    Thanks,

    Paul

    Posted 9 years ago on Sunday April 10, 2011 | Permalink
  4. You would use the Entry ID in the Notification message. You don't use the entry ID to populate a hidden field because the entry ID isn't created until the entry is created. It doesn't exist before then.

    Posted 9 years ago on Monday April 11, 2011 | Permalink
  5. I want to use the entry Id to identify unique applicants to our art show.
    I understand how to use it in the notification to the artist. A second form is for submitting the booth fee by an accepted artist. Can this id number be used to cross-reference the forms? How are these ids integrated to the paypay add-on?

    don't know how to give you a link to the forms since neither are live? Don't think you can see it with this link to the preview?
    http://www.aofta.org/?gf_page=preview&id=3

    sorry if this is not the right place to post. can you help?

    Posted 7 years ago on Friday February 8, 2013 | Permalink
  6. The preview page will not help us since we can't see it unless we're logged in as an administrator on your site.

    Can you explain how you're using two forms now and how you want to use the entry ID in both?

    Posted 7 years ago on Saturday February 9, 2013 | Permalink
  7. 1. artists use an application form to enter the selection process and pay an application fee via paypal addon for the show (form 1)
    2. the accepted artists can then use the booth selection form to book a space in the show (form2) and pay the booth fee via paypal addon.

    i can set-up notifications for both and understand that i can use the merged field to indicate an "application ID" that is the entry ID for the application form. It would be nice to be able to cross-reference the the databases / use one code for all the transactions/communications for each artist who applies.

    Posted 7 years ago on Saturday February 9, 2013 | Permalink
  8. I would also like to know how to generate a Customer Reference number for every form that is submitted, it would be great for the customer to call in and have that customer Reference number so that I can look up their file! Any help is greatly appreciated!

    Posted 7 years ago on Saturday February 9, 2013 | Permalink
  9. The Entry ID is unique across all forms. Can you use that as the Customer Reference number?

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  10. Hi Chris, At the moment, the Entry ID seems to be a little small, I was looking for a Reference number to be more like : PTL38700987 or something like that, I did come across a code here on this gravity forms forum and I inputted this code onto theme functions functions.php, the code is as follows:

    add_filter("gform_field_value_uuid", "uuid");
    function uuid($prefix = '')
     {
        $chars = md5(uniqid(mt_rand(), true));
        $uuid  = substr($chars,0,8) . '-';
        $uuid .= substr($chars,8,4) . '-';
        $uuid .= substr($chars,12,4) . '-';
        $uuid .= substr($chars,16,4) . '-';
        $uuid .= substr($chars,20,12);
        return $prefix . $uuid;
      }

    But it generates a customer ID number like this: a380db3e-19b7-30b1-f037-6305cf856a4f
    It looks more like a serial number than a customer reference number lol I'm afraid to manipulate this code because I added another code that I found on the forums here and it completely crashed my wordpress site and I had to do a restore last night, I nearly had a heart attack! Any advice is really appreciated! Thanks again for your help!

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  11. Hi Chris, I also wanted to show you the code that messed up the wordpress for me and forced me to do a restore:

    <?php
    
    add_filter("gform_field_value_uuid", "get_unique");
    
    function get_unique(){
    
        $prefix = "BDWA"; // update the prefix here
    
        do {
            $unique = mt_rand();
            $unique = substr($unique, 0, 8);
            $unique = $prefix . $unique;
        } while (!check_unique($unique));
    
        return $unique;
    }
    
    function check_unique($unique) {
        global $wpdb;
    
        $table = $wpdb->prefix . 'rg_lead_detail';
        $form_id = 7; // update to the form ID your unique id field belongs to
        $field_id = 1; // update to the field ID your unique id is being prepopulated in
        $result = $wpdb->get_var("SELECT value FROM $table WHERE form_id = '$form_id' AND field_number = '$field_id' AND value = '$unique'");
    
        if(empty($result))
            return true;
    
        return false;
    }
    
    ?>

    I go this code from this link: http://www.gravityhelp.com/forums/topic/guid-entry-id it was posted by David smith, I did as he suggested, changed the prefix, form ID and field ID and then it completely crashed my site, I had to call support to do a restore :( not sure what I did wrong but im terrified to touch the code lol, I did try the first code that generates that long serial number and that word wonderfully, its just that the number is way tooooo long. Thanks again.

    Marlene

    https://www.prestotaxilimo.com

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  12. I would forget about your second example. We can make the first example more useful. Does the number need to be guaranteed unique, and what does this number mean to you: PTL38700987 (other than the PLT part)? Can we just generate a random 8 digit number, and add PLT to the front of it? You can use this if that works for you:

    NOTE: see revised code here:
    http://www.gravityhelp.com/forums/topic/send-confirmation-number#post-145509

    Did you already add a uuid field to your form which will hold this value? Are you OK with it being called uuid?

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  13. Oh yes, most definitely, I dont mind it being called uuid. The code I am currently using is the first one that generates a serial number but of course, I would prefer more of a reference number that starts with PTL (Presto Taxi Limo) and then a mix of 11 numbers together with letters or just numbers is fine too. So it would look something like this PTL87X98CB987F, It should be guaranteed unique only because we will need to reference this number back to the client when they call in and it would suck if we had a duplicate happen but I think because the number is so complex, it probably is unlikely that it will happen, I dont think that will be an issue. So currently i'm using this code:

    add_filter("gform_field_value_uuid", "uuid");
    function uuid($prefix = '')
     {
        $chars = md5(uniqid(mt_rand(), true));
        $uuid  = substr($chars,0,8) . '-';
        $uuid .= substr($chars,8,4) . '-';
        $uuid .= substr($chars,12,4) . '-';
        $uuid .= substr($chars,16,4) . '-';
        $uuid .= substr($chars,20,12);
        return $prefix . $uuid;
      }

    and its working great, could you guide me on how I can add your code so that my site doesn't crash? lol THANK YOU AGAIN, I feel we are so close to getting this right!

    P.S. If I add your code, should I remove the above code I have been using or do they go together? You have been most helpful, as you can probably tell, I have no experience with this stuff but im very intrigued!

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  14. Remove all the code from before and just use the code here:
    http://www.gravityhelp.com/forums/topic/send-confirmation-number#post-145386

    Those 5 lines instead of the 11 which resulted in these long numbers:
    a380db3e-19b7-30b1-f037-6305cf856a4f

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  15. OK HERE GOES :D I'll be back to tell you how it went!

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  16. The great news is the code worked, so when I submitted a form, I got this 72200747 , would there be a way to add the PTL to the beginning of that # and maybe adding another 3 numbers to that just to be sure we dont get a repeat? THANK YOU! So sorry for being a pain!

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  17. Sorry, I changed my example before I posted it and posted the wrong version. Replace that code with this code:

    [php]
    add_filter('gform_field_value_uuid', 'customer_reference');
    function customer_reference(){
    	$number = mt_rand(10000000000, 99999999999);
    	return 'PLT' . substr($number,0,11);
    }

    I just changed it to add 3 more digits as well.

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  18. AWESOME!! It worked wonderfully!! Thank you!!!!! Now, I just have to get the total to double on those dates and we are set! LOVING Gravity forms! THANK YOU AGAIN! you guys here are so awesome!!

    Posted 7 years ago on Sunday February 10, 2013 | Permalink
  19. You're welcome. I'm still thinking about the double price thing ...

    Posted 7 years ago on Sunday February 10, 2013 | Permalink

This topic has been resolved and has been closed to new replies.