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.

E-mailing a notification build in functions.php to the user

  1. Hi GF support team

    In this thread (http://www.gravityhelp.com/forums/topic/making-a-result-page-based-on-conditional-logic) you helped me to build a notification message, that is based on the input from the user, this is working great by the way!

    1. I would like to give the users the option to e-mail the results (notification message) to them selves.
    In my opinion the best place to put this option, is when they see the notification. So I would really like to have one or more input fields at the bottom of the notification message, where the user can input his/or hers e-mail address, click send, and have the notification message send to them.
    If I could update the database with that info, and have the admin notification contain that info as well, that would be great! :-)

    1.1 If that is not possible, then I would like to place that option before they submit the form, and generate the message. But I really hope to do nr. 1 :-)

    Can I email the notification that I am "building" in functions.php to the user? And how do I do this?

    Thanks
    Carsten

    P.s.
    If I can get some input fields on the notification message, then I would like to have more than the e-mail field, but I hope to figure out how to do this, after learning how to implement the e-mail field. ;-)

    Posted 13 years ago on Monday September 5, 2011 | Permalink
  2. Hi Carsten. I will post something for you regarding this on Tuesday 6 September. Thanks

    Posted 13 years ago on Tuesday September 6, 2011 | Permalink
  3. Hi Chris

    I am looking forward to that :-)

    /Carsten

    Posted 13 years ago on Tuesday September 6, 2011 | Permalink
  4. You've already built the custom confirmation and are returning it via the gform_confirmation filter. The problem is that it's too late to send the user notification: it's already been sent. So, you need to take the confirmation, and allow them to send that message to themselves (actually, anyone, if you allow them to enter an email address here). But you're technically still on the same page as you were before they submitted (the page where the original form was submitted) and there really isn't a way to embed another form there.

    You could include a link to a page with another form in it. The link text could be "Send a copy of these results to your email" or something similar, and clicking that would take them to a page where they enter their name and email then click submit. For that to work, you would have to pass some data between the two forms. The confirmation message is likely too long for the query string, so it would be better to pass the entry ID. Then you could get the confirmation text for that entry, assuming the confirmation is stored in the entry somewhere. With the gform_confirmation hook, I don't believe it's stored.

    Passing the entry ID in the query string would also permit anyone to just change the query string and retrieve other people's confirmations.

    Knowing what you want to do with this message now I think creating it as a confirmation is a bad idea, since it's not stored, and we want to reuse it.

    Instead, you could use the gform_pre_submission hook to create the confirmation message, and store it in the entry. It would be nice if you had their email up front as well, so you send only to the email in the entry, not any old email they want. You would send the confirmation to only the email address that matches that entry.

    Might require some rethinking at this point. Please post any ideas you may have.

    Posted 13 years ago on Tuesday September 6, 2011 | Permalink
  5. Hi Chris

    I have a lot of ideas of what I would like to do, my problem is that I do not know how to do it, and my challenge is to explain the ideas in written English.

    I think that you might be on to something with the gform_pre_submission hook, but I am not sure.

    My thinking about this test, that I am creating, is that it brings some real value to the user of/visitor to our website, and at the same time, it can be a very good lead generation tool for our business.
    We (me and my partners) think that the user is most motivated to enter their contact details, after seeing the results of the test, and that is why we would like to be able to do that.
    If the user gets to see the results (right now that is the notification message) and then gets the option to enter their contact data, and opt for a call from us, so that we can discuss how we can help to improve on the results of the test, that will probably be the best way to generate leads to our business. The "carrot" for the user, would be that they can e-mail the results to them selves. (Does this explanation make sense?)

    The issue about safety, that other people could swap out the id, to retrieve some other persons data, is not something that we want to happen, so we can not do it that way.

    I hope that it is be possible to do the above with GF. One way, that I am thinking might be possible: Is if I can show a rather long customized message in the form, before it is finished, I think that would do the trick.
    I am already having the form on four different pages, using the functionality build into GF, I am thinking that it would be very nice, if one of the next buttons could activate the creation of the message, the next page would then show the message, and the possibility to fill out the last fields of the form, and click submit. This would be very nice!

    Is this what you had in mind when you asked for ideas form me?

    Thanks
    Carsten

    Posted 13 years ago on Tuesday September 6, 2011 | Permalink
  6. You have a very interesting use case here and have explained it very well in English; no problem there.

    I think we may have to switch to using the gform_pre_render rather then the gform_confirmation hook, because we're going to want to have access to it and reuse it.

    I think what might work, at least to start, is to switch to gform_pre_render so we can store your customized message and results with the entry. That also gives you the ability to refer back to what you created for this individual. That would be step one.

    Then, on the confirmation settings for your form (Advanced tab) we will probably redirect to a page. Then in that page we will show the confirmation message you crafted.

    The trick is going to be getting the entry ID from the form to the following page without allowing anyone to change that and see other results.

    On the page where you display their customized results, you can have another form, for name and email address, for them to request a copy of their report be emailed to them. You have all the information on the page, and in the entry, so I think we will be able to send it to them from here.

    Are you really doing all this work for them up front, with no personal data from them? You're not collecting a name or email early on in their process? They could get to the last page, print the results and disappear?

    Posted 13 years ago on Wednesday September 7, 2011 | Permalink
  7. Hi Chris

    Your suggestion sounds really interesting! I would very much like to try that, do you have any example code laying around? ;-)

    And to answer you question, yes we would like to try to do it this way as a start, and maybe we will change it later, and ask for some more information up front, but for now we want to try to do it this way.

    Thanks
    Carsten

    P.s. For some reason the "Subscribe to this Topic Via Email" is not working for me, it is not really important, as I frequently look for a reply, I just wanted to let you know.

    Posted 13 years ago on Thursday September 8, 2011 | Permalink
  8. Hi Carsten. The "subscribe to topic" function of bbPress is flaky. I'm glad you don't have to rely on it.

    I will look around for some code for you. Keep thinking :-)

    Posted 13 years ago on Friday September 9, 2011 | Permalink
  9. Hi Chris

    Thanks, I will do that while I look forward to that code :-)

    Posted 13 years ago on Monday September 12, 2011 | Permalink
  10. I just wanted to let everyone that comes across this message know, that the GF support team pointed me towards http://ounceoftalent.com/ to get some help on this one. I asked if they knew a good programmer that could help me :-)

    And that worked out really good, http://ounceoftalent.com/ gets my highest recommendations. Everything works as expected now, and all that I wanted to do, was possible, I am very happy.

    Posted 13 years ago on Thursday December 8, 2011 | Permalink

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