January 31, 2020: Fixed issue where email was not sent due to formatting issue in code.
This handy snippet allows you to send an email notification to the user who submitted a Gravity Forms generated post when that post is published.
This snippet assumes you have created a Post Custom Field which will store the submitting user’s email address. You would then specify the “Custom Field Name” you specified for the field as the $custom_field_name variable.
For example, assuming I had configured a Post Custom Field with the following settings:
I would set the $custom_field_name variable like so:
$custom_field_name = 'author_email';
Lastly, don’t forget to set your basic email settings!
$from_name = 'Your Name'; $from_email = 'firstname.lastname@example.org'; $subject = 'Your Subject Here'; $message = 'Your message here.';