Using Gravity Forms ‘gform_post_send_entry_note’ PHP action

The gform_post_send_entry_note action is triggered after an entry note is emailed, allowing you to perform further actions.

Usage

add_action('gform_post_send_entry_note', 'my_function', 10, 7);

Parameters

  • $result (string): The success or failure message, based on if the email was sent successfully or not.
  • $email_to (string): The address that the email was sent to.
  • $email_from (string): The email address that the email was sent from.
  • $email_subject (string): The subject of the email sent.
  • $body (mixed): The body of the email sent.
  • $form (Form Object): The current form object.
  • $entry (Entry Object): The current entry object.

More information

See Gravity Forms Docs: gform_post_send_entry_note

This action hook is located in entry_detail.php.

Examples

Log Email Details

Log the details of the sent entry note email.

function log_email_details($result, $email_to, $email_from, $email_subject, $body, $form, $entry) {
  // Log email details
  error_log("Email Result: " . $result);
  error_log("Email To: " . $email_to);
  error_log("Email From: " . $email_from);
  error_log("Email Subject: " . $email_subject);
}
add_action('gform_post_send_entry_note', 'log_email_details', 10, 7);

Send a Custom Email after Entry Note

Send a custom email to the admin after an entry note is emailed.

function send_custom_email($result, $email_to, $email_from, $email_subject, $body, $form, $entry) {
  // Send a custom email to the admin
  wp_mail('[email protected]', 'Entry Note Sent', 'An entry note has been sent to ' . $email_to);
}
add_action('gform_post_send_entry_note', 'send_custom_email', 10, 7);

Update Entry after Emailing Note

Update entry data after the entry note is emailed.

function update_entry_after_email($result, $email_to, $email_from, $email_subject, $body, $form, $entry) {
  // Update entry data
  $entry['status'] = 'completed';
  GFAPI::update_entry($entry);
}
add_action('gform_post_send_entry_note', 'update_entry_after_email', 10, 7);

Add a Note after Emailing Note

Add a note to the entry after the entry note is emailed.

function add_note_after_email($result, $email_to, $email_from, $email_subject, $body, $form, $entry) {
  // Add a note to the entry
  $note = "An entry note was sent to {$email_to}.";
  GFAPI::add_note($entry['id'], $note, '0', 'email');
}
add_action('gform_post_send_entry_note', 'add_note_after_email', 10, 7);