Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Created March 13, 2015 15:37
Show Gist options
  • Select an option

  • Save kjohnson/50c55745fd63bdbf21fc to your computer and use it in GitHub Desktop.

Select an option

Save kjohnson/50c55745fd63bdbf21fc to your computer and use it in GitHub Desktop.
Add an Attachment to Email Notifications in Ninja Forms
<?php
/*
Plugin Name: Ninja Forms Email Attachment
*/
function add_my_attachment( $attachments ) {
$attachments[] = 'server_path_to_my_file';
return $attachments;
}
add_filter( 'nf_email_notification_attachments' , 'add_my_attachment' );
@ouija
Copy link

ouija commented Oct 31, 2021

Just also wanted to mention to others who my enqire, to get the post_id for the submission, it's stored under $data['actions']['save']['sub_id'] (but you need to have "store submission" enabled)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment