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.

Data Injection inside confirmation email

  1. Gravitiy users and hackers,

    I hope someone can help me here, as i'm not the best programmer for this kind of stuff

    Problem
    After a user submits a form, they get a confirmation email with a nice thank you. But what i want inside that email, is a unique code (i got 1000s of them) that the user can use to buy something nice from a other website

    To be stupid clear here.. : If there are 1000 unique coupon codes, and it will display 1 coupon after a customer sends his data, there should be only 999 left ofcourse in the database somewhere.

    Possible solution (is there one?)
    I can inject those codes inside the SQL database and make a simple php script that inject this inside the delivered email.

    How do i do that?

    Frank Edens
    PS : If someone has a better idea, i'm open for that also :)

    Posted 7 years ago on Wednesday September 7, 2011 | Permalink
  2. You will want to use the gform_pre_submission filter so you can modify the notification before it's sent. It should be no problem. You will need to decide how you pull a coupon code and keep track that it has been used so it's not given out again.

    Posted 7 years ago on Wednesday September 7, 2011 | Permalink