Last active
June 5, 2018 21:41
-
-
Save rafaehlers/1d147c5e6a6c42dce259df7a653f2706 to your computer and use it in GitHub Desktop.
Send a form notification when an entry is approved/disapproved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('gravityview/approve_entries/disapproved','gv_send_form_notification_approval'); | |
add_action('gravityview/approve_entries/approved','gv_send_form_notification_approval'); | |
function gv_send_form_notification_approval($entry_id){ | |
$entry = GFAPI::get_entry( $entry_id ); | |
if( ! $entry || is_wp_error( $entry ) ) { | |
return; | |
} | |
$form = GFAPI::get_form( $entry['form_id'] ); | |
if( ! $form || is_wp_error( $form ) ) { | |
return; | |
} | |
GFCommon::send_form_submission_notifications( $form, $entry ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment