I have a plugin that I've written that is trying to call the gforms_after_submission hook. For some reason it isn't calling the function. I see in Gravity Forms documentation that it says I have to call gform_after_submission from the functions file - is there any reason I can't call it from the plugin? I've tested with the mail function, and the function admin_init is triggering.
<?php
class Infusionsoft_GformsPDF {
public function __construct() {
add_action( 'admin_init', array( $this, 'admin_init' ) );
}
/**
* Should call my function, but doesn't
*/
public function admin_init() {
add_action('gform_after_submission', 'handle_file', 10, 2);
}
/**
* Get the file URL and post it to Infusionsoft
*/
public function handle_file($entry, $form){
mail('myemail@email.com', 'Handle File was triggered', 'yippee');
}
}