Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zackkatz/de7e54f0869741f98c9c50848f4de087 to your computer and use it in GitHub Desktop.
Save zackkatz/de7e54f0869741f98c9c50848f4de087 to your computer and use it in GitHub Desktop.
Modify an entry note email
<?php
add_filter( 'gravityview/field/notes/email_content', 'gv_modify_notes_email_content', 10, 4 );
/**
* Modify the values passed when sending a note email
* @see GVCommon::send_email
* @since 1.17
* @param array $email_settings Values being passed to the GVCommon::send_email() method: 'from', 'to', 'bcc', 'reply_to', 'subject', 'message', 'from_name', 'message_format', 'entry', 'email_footer'
*
* @return array $email_settings
*/
function gv_modify_notes_email_content( $email_settings ) {
extract( $email_settings );
$email_settings['from'] = $from; //example@gmail.com
$email_settings['to'] = $to; //example@gmail.com
$email_settings['bcc'] $bcc; //example@gmail.com
$email_settings['reply_to'] = $reply_to; //example@gmail.com
$email_settings['subject'] = $subject; //subject of the email
$email_settings['message'] = $message; //body of the email (already in HTML format)
$email_settings['from_name'] = $from_name; //Example: GravityView Website
$email_settings['message_format'] = $message_format; //html
$email_settings['email_footer'] = $email_footer; //The text: This note was sent from {url}
$email_settings['entry'] = $entry; // The entry array that the note is being added to
return $email_settings;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment