Created
October 9, 2015 15:17
-
-
Save kjohnson/3ffddc907553fc6e4244 to your computer and use it in GitHub Desktop.
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 characters
| <?php | |
| /* | |
| Plugin Name: Ninja Forms - Custom Attachment Filter | |
| */ | |
| add_filter( 'nf_email_notification_attachments', 'my_custom_attachment', 9001, 2 ); | |
| function my_custom_attachment( $attachments, $action_id ){ | |
| // TODO: Set your own ID for your action | |
| // Confirm the Action ID is the intended email action. | |
| if( '60' != $action_id ) return $attachments; | |
| // TODO: Set your own file path for your attachment | |
| // Create Attachment File Path | |
| $file_path = WP_CONTENT_DIR . '/uploads/ninja-forms/-001.png'; | |
| // Push File Path to attachments array | |
| $attachments[] = $file_path; | |
| // Return the updated attachments array | |
| return $attachments; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment