We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50574
    • 70 Posts
    Is there a way to pull the ID of a form that is saved into the Formit DB and call that into the send email template?
    I need to create a unique reference for each email sent and include it in the customer email that is sent when submitted. This seemed like the most logical solution.

    Thanks in advance

    This question has been answered by comp_nerd26. See the first response.

      • 47401
      • 295 Posts
      rather than using the ID, why dont you use a hidden field with a reference number? i.e yyyy-mm-dd H:i:s or unix timestamp. you could use modx or javascript to create the unique number. that way when the form gets inserted all you do is reference the input name in the email template smiley
      • discuss.answer
        • 47401
        • 295 Posts
        for example:

        <input type="hidden" name="refnum" value="[[snippet]]">
        
        

        snippet:
        <?php
        return date('yyyy-mm-dd H:i:s',strtotime('NOW'));
        


        a a column refnum is created with the unique number in.

        call the hidden input in your email template
        [[+refnum]]
        

          • 50574
          • 70 Posts
          Perfect, thank you comp_nerd.

          I went with the following snippet to make it look a little less like date and time
          <?php
          return date('dm-yH-is',strtotime('NOW'));
            • 47401
            • 295 Posts
            great, happy to assist smiley