Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // attach the same file to all User Notifications
- // add_filter("gform_notification", "add_attachment", 10, 3);
- function add_attachment( $notification, $form, $entry ){
- // reference the notification by name
- if( $notification["name"] == "User Notification" ){
- // this is a path not a URL
- $uploadDir = get_stylesheet_directory();
- // this is the file to be attached to all notifications
- $attachment = $uploadDir.'/terms.pdf';
- $notification['attachments'] = array($attachment);
- }
- return $notification;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement