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 to Email Population Problems

  1. Hi, we have a shortcode from the S2Member plugin which will print the value of a custom profile field to a page or post; however it will not populate the "Send to" email address in either the Admin or User notification. [s2Get user_field="base_location_email" /] is the shortcode and it is functioning properly. We have set the email field in the form to Admin Only visibility and have the variable set to the shortcode mentioned above. We still cannot get Gravity Forms to send the email to anything other than a fully qualified email address in the Admin Notification section. In the User Notification section the send to drop down has the name of our Shortcode as the only option, yet we still are not receiving the email. How can we get Gravity Forms to populate both the Admin and User send to email field with the data being brought in by the shortcode? If this needs some clarification please let me know what part and I will try my best to clarify what I mean. Thanks.

    Posted 13 years ago on Tuesday November 1, 2011 | Permalink
  2. Hi Ksavoie,

    By default Gravity Forms does not process shortcodes for the notification properties or the field's defaultValue property. Here is a snippet which will process shortcodes in both places when placed in your theme's functions.php file:

    http://pastie.org/2795636

    Posted 13 years ago on Tuesday November 1, 2011 | Permalink
  3. Unfortunately that does not seem to work. I still get the red error box with the message "Please enter a vaild email address" when trying to use the shortcode in the admin "send to email" field. I noticed the code in your pastie link does not have a closing php tag. Just a note, It does not work for me with or without the closing ?> tag. Thanks for the reply, I'll look forward to another possible solution from you in this thread.

    Posted 13 years ago on Tuesday November 1, 2011 | Permalink
  4. Hi Ksavoie,

    Ah, I forgot to mention that you will want to change the visibility back to "Everyone" and then add a class to the field "gform_hidden". Admin only fields are not rendered on the form so the default value is never populated.

    Posted 13 years ago on Tuesday November 1, 2011 | Permalink
  5. David that appears to work for the "email" field; however we're still not able to get the Admin "Send to Email" field to process shortcodes. Each time we place a shortcode in that field in the admin notification section we get a "Please enter a vaild email address" error. Right now we have the User Notification sending the form results to the correct email, which is determined by a custom profile field for the logged in user. We'd like the admin notification email to be sent to that address rather than the user notification. That way we can send a confirmation to the user via the user notification email tool. If we could just get the admin notification "Send to Email" field to process shortcodes we'd we all set. Thanks again for your help and I'll look forward to hearing back from you.

    Posted 13 years ago on Wednesday November 2, 2011 | Permalink
  6. Hi Ksavoie,

    I did not understand that the editor was actually preventing you from saving the shortcode as the "to" address for the Admin notification message. Here is the updated code which will allow you to update the value of the Admin notification prior to the form submission:

    http://pastie.org/2799846

    Posted 13 years ago on Wednesday November 2, 2011 | Permalink
  7. David you have been great. Thanks for the code and guidance. We did end up getting it to do what we needed it to do with just a few tweaks to your code and directions. Thanks again.

    Posted 13 years ago on Wednesday November 2, 2011 | Permalink
  8. Thank you for the update.

    Posted 13 years ago on Thursday November 3, 2011 | Permalink

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