Created
December 18, 2025 07:08
-
-
Save aimahdi/95744be950e9949474c606ba7639be91 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'wp_new_user_notification_email', function ( $email, $user, $blogname ) { | |
| $reset_link = wp_lostpassword_url(); | |
| $email['subject'] = sprintf( | |
| 'Welcome to %s – Set your password', | |
| $blogname | |
| ); | |
| $email['message'] = sprintf( | |
| "Hi %s,\n\n". | |
| "Thanks for your purchase! We've created your account on %s.\n\n". | |
| "To access your account and manage your profile, please set your password using the link below:\n\n". | |
| "%s\n\n". | |
| "If you didn’t request this, you can safely ignore this email.\n\n". | |
| "Best regards,\n". | |
| "%s Team", | |
| $user->display_name ?: $user->user_login, | |
| $blogname, | |
| $reset_link, | |
| $blogname | |
| ); | |
| return $email; | |
| }, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment