Being able to send a confirmation email to a non-WP registered (anonymous/guest) submitter, when their post has been approved, seems to be a very much requested feature by lots of users (including myself!).
I can appreciate why it can't be done yet in Gravity Forms (although it should be in a future release), however I believe the code below would be a suitable, simple solution.
The following assumes that you're already collecting an email address on the form, that its a required field and that the email address is being stored in a unique custom field.
So simply add this code into your theme's functions.php file, replacing YOUR_CUSTOMFIELD_KEY with the name of the custom field that you're using to collect the email address.
function email_members($post_ID) {
global $post;
$email_to = get_post_meta($post->ID, 'YOUR_CUSTOMFIELD_KEY', true);
$headers = 'From: Name <name@name.com>' . \\"\r\n\\";
$subject = "Your subject here";
$message = "Your message here";
wp_mail($email_to, $subject, $message, $headers);
return $post_ID;
}
add_action('publish_post', 'email_members');
You can even do fancy things like displaying the permalink in the body of the message. Add this at the top of that code:
$permalink = get_permalink( $post->ID );
and then simply add $permalink into the $message variable e.g.
$message = "Your message here " . $permalink . ". And then more text here!";
It seems to be working for me and so in the spirit of open-source I just thought I'd share this with everyone else too!
Duncan