| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template contains the HTML for the Friend Message Received notification e-mail. |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
$ensure_linebreaks = preg_replace( '/\<br(\s*)?\/?\>/i', PHP_EOL, $args['message'] ); |
| 10 |
$plain_text = wp_strip_all_tags( $ensure_linebreaks ); |
| 11 |
$normalized_whitespace = preg_replace( '/(' . PHP_EOL . '\s*' . PHP_EOL . ')+/m', PHP_EOL . PHP_EOL, $plain_text ); |
| 12 |
$quoted_text = '> ' . str_replace( PHP_EOL, PHP_EOL . '> ', trim( $normalized_whitespace ) ); |
| 13 |
|
| 14 |
// This is a text e-mail, not a place for HTML escaping. |
| 15 |
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped |
| 16 |
|
| 17 |
// translators: %s is a user display name. |
| 18 |
printf( __( 'Hi %s!', 'friends' ), $args['user']->display_name ); |
| 19 |
echo PHP_EOL; |
| 20 |
|
| 21 |
// translators: %s is a username. |
| 22 |
printf( __( 'We just received a message from %s:', 'friends' ), $args['friend_user']->display_name ); |
| 23 |
echo PHP_EOL . PHP_EOL; |
| 24 |
|
| 25 |
echo $quoted_text; |
| 26 |
|
| 27 |
esc_html_e( 'Open the conversation to respond.', 'friends' ); |
| 28 |
echo PHP_EOL . PHP_EOL; |
| 29 |
|
| 30 |
echo $args['message_url']; |
| 31 |
|