| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template contains the text 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 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 19 |
echo PHP_EOL; |
| 20 |
|
| 21 |
// translators: %s is a username. |
| 22 |
printf( __( 'We just received a message from %s:', 'friends' ), $args['sender_name'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 23 |
echo PHP_EOL . PHP_EOL; |
| 24 |
|
| 25 |
echo $quoted_text; |
| 26 |
|
| 27 |
// translators: %s is a URL. |
| 28 |
printf( wp_strip_all_tags( __( 'Maybe you want to <a href=%s>follow them</a> to respond?', 'friends' ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 29 |
echo PHP_EOL . PHP_EOL; |
| 30 |
|
| 31 |
echo home_url( '?add-friend=' . esc_url( $args['feed_url'] ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 32 |
|