Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. public function __construct() {
  2. // Stop any PDFs from being immediately generated (require Gravity Forms Delayed Email Notifications)
  3. add_filter( 'gfpdf_maybe_attach_to_notification', array( $this, 'require_delayed_notifications' ), 10, 5 );
  4. }
  5.  
  6. public function require_delayed_notifications( $attach, $notification, $settings, $entry, $form ) {
  7.  
  8. // Disable Gravity PDF attachment if the notification has a flag (__AFTER_DELAY_FLAG__) letting us know that this notification is supposed to wait until after the delay
  9. if ( preg_match( '/__AFTER_DELAY_FLAG__/', $notification['subject'] ) ) {
  10. return false;
  11. }
  12.  
  13. return $attach;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement