i have registration form
and also form for restoring password
i was need to change template of letter for mail
because i wanna put some information like this ( =>
<p>Если у вас возникли трудности или ошибки – оставьте тикет в службу поддержки.</p>
<p><strong><a href="%s">Служба технической поддержки</a></strong></p>
) in mail letter
i made this code for solving my task(code include in the down)
<?php
function custom_new_user_notification_email($wp_new_user_notification_email, $user, $blogname) {
// Проверяем, что это именно письмо о регистрации нового пользователя
if (isset($_POST['reg_password'])) {
$support_link = 'some link';
$login_link = 'some link';
// Получаем пароль пользователя из поля формы
$user_pass = isset($_POST['reg_password']) ? $_POST['reg_password'] : 'Пароль не найден';
$wp_new_user_notification_email['subject'] = 'Добро пожаловать на ' . $blogname;
$wp_new_user_notification_email['headers'] = array('Content-Type: text/html; charset=UTF-8');
$wp_new_user_notification_email['message'] = sprintf(
'<html>
<head>
<style>
body { font-family: Arial, sans-serif; font-size: 14px; color: #333; }
a { color: #0073aa; text-decoration: none; }
</style>
</head>
<body>
<p>Привет, %s!</p>
<p>Спасибо за регистрацию на сайте <strong><a href="some link">golitsina.com</a></strong>.</p>
<p>Ваш логин: <strong>%s</strong></p>
<p>Ваш пароль: <strong>%s</strong></p>
<p>Чтобы войти, используйте ссылку: <a href="%s">Войти</a></p>
<p>Если у вас возникли трудности или ошибки – оставьте тикет в службу поддержки.</p>
<p><strong><a href="%s">Служба технической поддержки</a></strong></p>
</body>
</html>',
$user->display_name,
$user->user_login,
$user_pass,
$login_link,
$support_link
);
}
return $wp_new_user_notification_email;
}
add_filter('wp_new_user_notification_email', 'custom_new_user_notification_email', 10, 3);
and registation form was works as i wanna
but after i noticed that when i make reset of password – mail did’t come in my email, but registration form works as before
if i will delete my new code – everything works and i will receive mail if i will restore password
i was read in some place that this
wp_new_user_notification_email
have some connection with template of restoring password
i checked folder Spam
i tried make checking by this because after making reset my url will have url like this – ?reset-link-sent=true
if ( isset( $_GET['reset-link-sent'] ) && $_GET['reset-link-sent'] === 'true' ) {
return $wp_new_user_notification_email;
}
but didnt help
i havent access to activate debugging, only wordpress – therefore i dont see mistakes
its mean problem now that i cant make restoring of password – because i will not receive mail
