Title: wp_send_note_notification
Published: August 20, 2026

---

# wp_send_note_notification( WP_User $user, WP_Comment $comment, WP_Post|null $post ): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#wp--skip-link--target)

Sends a single note mention notification email.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#description)󠁿

The email is composed in the recipient’s locale, matching how other user-directed
notifications are composed, and links to the post editor the same way the post author’s
note notification does.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#parameters)󠁿

 `$user`[WP_User](https://developer.wordpress.org/reference/classes/wp_user/)required

The recipient.

`$comment`[WP_Comment](https://developer.wordpress.org/reference/classes/wp_comment/)
required

The note that triggered the notification.

`$post`[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)|nullrequired

The post the note belongs to.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#return)󠁿

 bool Whether the email was accepted for delivery by [wp_mail()](https://developer.wordpress.org/reference/functions/wp_mail/).

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#source)󠁿

    ```php
    function wp_send_note_notification( WP_User $user, WP_Comment $comment, ?WP_Post $post ): bool {
    	$switched_locale = switch_to_user_locale( $user->ID );

    	/*
    	 * The site title and the post title are escaped on the way into the database,
    	 * and note content is stored as HTML. Both are reversed once here for the
    	 * plain text arena of emails. Decoding a second time would go too far and
    	 * resolve entities the author meant to be read literally.
    	 */
    	$blogname    = wp_specialchars_decode( get_bloginfo( 'name', 'display' ), ENT_QUOTES );
    	$post_title  = $post ? wp_specialchars_decode( get_the_title( $post ), ENT_QUOTES ) : '';
    	$author_name = $comment->comment_author ? $comment->comment_author : __( 'Someone' );
    	$content     = wp_specialchars_decode( wp_strip_all_tags( $comment->comment_content ) );

    	/*
    	 * The rest of the message is composed for the recipient, and so is the editor
    	 * link: get_edit_post_link() answers for whoever is current, which here is the
    	 * note's author over REST and nobody at all under WP-Cron.
    	 */
    	$edit_link = '';
    	if ( $post ) {
    		$previous_user_id = get_current_user_id();
    		wp_set_current_user( $user->ID );
    		$edit_link = (string) get_edit_post_link( $post->ID, 'url' );
    		wp_set_current_user( $previous_user_id );
    	}

    	/* translators: 1: Note author's name, 2: Post title. */
    	$message = sprintf( __( '%1$s mentioned you in a note on "%2$s".' ), $author_name, $post_title );
    	/* translators: Note mention notification email subject. 1: Site title, 2: Post title. */
    	$subject = sprintf( __( '[%1$s] You were mentioned in a note on "%2$s"' ), $blogname, $post_title );

    	$lines = array( $message, '' );
    	if ( '' !== $content ) {
    		$lines[] = $content;
    	}
    	if ( $edit_link ) {
    		$lines[] = '';
    		$lines[] = __( 'Edit This' ) . ': ' . $edit_link;
    	}

    	// Declared explicitly so a filtered default cannot turn the message into HTML.
    	$headers = 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . '"';

    	$sent = wp_mail( $user->user_email, $subject, implode( "\n", $lines ), $headers );

    	if ( $switched_locale ) {
    		restore_previous_locale();
    	}

    	return $sent;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/comment.php#L2727)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/comment.php#L2727-L2778)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#related)󠁿

| Uses | Description | 
| [switch_to_user_locale()](https://developer.wordpress.org/reference/functions/switch_to_user_locale/)`wp-includes/l10n.php` |

Switches the translations according to the given user’s locale.

  | 
| [restore_previous_locale()](https://developer.wordpress.org/reference/functions/restore_previous_locale/)`wp-includes/l10n.php` |

Restores the translations according to the previous locale.

  | 
| [wp_strip_all_tags()](https://developer.wordpress.org/reference/functions/wp_strip_all_tags/)`wp-includes/formatting.php` |

Properly strips all HTML tags including ‘script’ and ‘style’.

  | 
| [wp_specialchars_decode()](https://developer.wordpress.org/reference/functions/wp_specialchars_decode/)`wp-includes/formatting.php` |

Converts a number of HTML entities into their special characters.

  | 
| [wp_set_current_user()](https://developer.wordpress.org/reference/functions/wp_set_current_user/)`wp-includes/pluggable.php` |

Changes the current user by ID or name.

  | 
| [wp_mail()](https://developer.wordpress.org/reference/functions/wp_mail/)`wp-includes/pluggable.php` |

Sends an email, similar to PHP’s mail function.

  | 
| [get_edit_post_link()](https://developer.wordpress.org/reference/functions/get_edit_post_link/)`wp-includes/link-template.php` |

Retrieves the edit post link for post.

  | 
| [get_the_title()](https://developer.wordpress.org/reference/functions/get_the_title/)`wp-includes/post-template.php` |

Retrieves the post title.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [get_bloginfo()](https://developer.wordpress.org/reference/functions/get_bloginfo/)`wp-includes/general-template.php` |

Retrieves information about the current site.

  | 
| [get_option()](https://developer.wordpress.org/reference/functions/get_option/)`wp-includes/option.php` |

Retrieves an option value based on an option name.

  | 
| [get_current_user_id()](https://developer.wordpress.org/reference/functions/get_current_user_id/)`wp-includes/user.php` |

Gets the current user’s ID.

  |

[Show 7 more](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#)

| Used by | Description | 
| [wp_notify_note_mentions()](https://developer.wordpress.org/reference/functions/wp_notify_note_mentions/)`wp-includes/comment.php` |

Notifies mentioned users about a new note.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_send_note_notification/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_send_note_notification%2F)
before being able to contribute a note or feedback.