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 an Email stored in a Custom Field

  1. I have a Custom Post Type, which has a custom field called email. It's an email address. I want my form which is loaded into the same Custom Post, to send this email address variable that is in the current custom post, instead of the admin.

    Each custom post would have a different email, so I need it to read the custom field 'email' and send to that.

    Any ideas... I'm using WP-Types and the Custom Post plugin

    Thanks in advance....

    Posted 9 years ago on Sunday September 16, 2012 | Permalink
  2. Basically, the merge tag will be {custom_field:key}, where "custom_field" is literal and "key" is your actual key name (sounds like you used "email" as the key? - If so, then your merge tag would be {custom_field:email} ).

    Does that help?

    Posted 9 years ago on Sunday September 16, 2012 | Permalink
  3. When i try paste: {custom_field:email} into the Send to Email field under User Notifications - I get a validation error... "Please enter a valid email address"

    Maybe I'm doing something wrong?

    Posted 9 years ago on Sunday September 16, 2012 | Permalink
  4. I don't think you're doing anything wrong. I forgot there is validation for that field to be sure you enter a valid email address. Let me look around for the solution.

    Posted 9 years ago on Monday September 17, 2012 | Permalink
  5. I am looking to do this as well. Is there a workaround for the email address validation?

    Posted 9 years ago on Monday September 17, 2012 | Permalink
  6. I see there are old posts about similar issues.

    Could there be some documentation on what we need to do, with some cut and paste code, etc?

    I think this is a very common request... send an email to the post author or to a custom field email

    Posted 9 years ago on Wednesday October 3, 2012 | Permalink
  7. Gavin Webb
    Member

    Hello - I'd like to add my request for this too. Thanks.

    Posted 9 years ago on Sunday October 7, 2012 | Permalink
  8. Sorry, please see this topic by Rob describing how to work around the limitation for the email address being invalid when you insert the merge tag:
    http://www.gravityhelp.com/forums/topic/routing-notifications-to-a-custom-field#post-68824

    Also, this further explanation from another user:
    http://www.gravityhelp.com/forums/topic/routing-notifications-to-a-custom-field#post-68845

    Posted 9 years ago on Monday October 8, 2012 | Permalink
  9. Gavin Webb
    Member

    Hi Chris - thanks for the reply. I looked at this post on Sunday and have tried the suggestions, but can't get it to work. Here's what I'm doing:

    I have a custom field - wpcf-email.

    I create the tag in Gravity Forms, {custom_field:wpcf-email}, and put this into Default Value field under Advanced tab of a Hidden field.

    Now, in Notifications I select the Routing radio button - and this is where I'm getting lost. Please can you explain what I need to put into this area of the Notification to Administrator:

    Send to ________ if ________ ________ ________

    Thanks. Gavin.

    Posted 9 years ago on Tuesday October 9, 2012 | Permalink
  10. Same here....

    Posted 9 years ago on Wednesday October 10, 2012 | Permalink
  11. I just configured a form to do this. Rather than use a hidden field, I added an email address field from the advanced settings, and marked the visibility "admin only". Then, I set the default value to {custom_field:wpcf-email}. Then after saving the form, I selected this admin only field as the "To" email address for the user notification.

    The big difference here is to use an email field and mark it "admin only" visibility, rather than a hidden field. Using an email field will enable it to show up in the drop down.

    Let me know if you have any trouble with this. Please note that this will not work from the form preview as there is no post and thus no custom field to hold the email address.

    Posted 9 years ago on Wednesday October 10, 2012 | Permalink
  12. Gavin Webb
    Member

    Hi Chris - thanks for your reply.

    Initially I was still confused, but here's what I did to make it work.

    1. Create an email field and name as required, e.g. Hidden Email
    2. Under the 'Advanced' tab mark as visibility 'admin-only'
    3. Set the default value under the 'Advanced' tab to {custom_field:wpcf-email}
    4. Go to 'Notifications' at the top of the page
    5. Select the 'Email' radio button under 'Send To Email'
    6. Insert a merge tag for the Hidden Email field, in my case {Hidden Email:5}
    7. Set the 'From Email' and 'Reply To' as required

    Now, I'm not sure if there is meant to be a dropdown on the 'Send To Email' field, but I haven't one, and this is certainly where some of the confusion was for me.

    Anyway, doing the above works great now.

    Thanks for your help Chris, all the best. Gavin.

    Posted 9 years ago on Friday October 12, 2012 | Permalink

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