Created
April 29, 2021 02:47
-
-
Save DeveloperWil/febc200640d774829260dcd7cd5b27fe to your computer and use it in GitHub Desktop.
Revisions
-
DeveloperWil created this gist
Apr 29, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ function gf_alexa_notification( $entry, $form ){ $notifyme_api_url = 'https://api.notifymyecho.com/v1/NotifyMe'; $notifyme_api_secret = '1234567890'; if( $form->ID === 12 ){ // Only for form ID=12 $firstname = rgar( $entry, '1.3' ); $lastname = rgar( $entry, '1.3' ); $phone = rgar( $entry, '2' ); $notification = $firstname . ' ' . $lastname . ' requested a callback on "' . $phone .'"'; $args = [ 'notification' => $notification, 'accessCode' => $notifyme_api_secret, ]; $response = wp_remote_post( $notifyme_api_url, $args ); } } add_action( 'gform_after_submission', 'gf_alexa_notification', 10, 2 );