Last active
November 2, 2021 18:24
-
-
Save chrisegg/c2ca07dc2e668d0c6b943555e0f774d5 to your computer and use it in GitHub Desktop.
Full tutorial on how to use this code here: https://gravityranger.com/attaching-a-file-to-your-gravity-forms-notifications/
This file contains 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 | |
// Do NOT include the opening php tag | |
// Replace 1 with your forms ID | |
// Replace User Notification with the name of your notification | |
// Insert your file path | |
add_filter( 'gform_notification_1', 'add_notification_attachments', 10, 3 ); | |
function add_notification_attachments( $notification, $form, $entry ) { | |
if ( $notification['name'] == 'User Notification' ) { | |
$path = 'path/to/file.pdf'; | |
$notification['attachments'] = array( $path ); | |
} | |
return $notification; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment