Username from e-mail

As far as i know there is no hook or filter to provide a custom User name for default registration process, however if you really want to modify it, you can alter the $_POST data. here is the sample code: add_action(‘wp_loaded’, ‘wpse_138736_filter_username’); function wpse_138736_filter_username(){ //your code to extract username from email $_POST[‘user_login’] = ‘test’; } … Read more

Send email from WordPress

Try to add some code to the functions.php like: add_action(‘publish_post’,’send_email’); function send_email() { // write some code with wp_mail function. } I think you can use the $post to get the post info. For comments I guess you can use: add_action(‘comment_post’, ‘send_email’); Let me know if you need some more help!

How do I replace the e-mail form to functional e-mail subscription? [closed]

For sending mass emails I wouldn’t recommend sending them from your email program nor from WordPress; instead, I would recommend a third-party service that specializes in sending emails – in particular, I usually recommend MailChimp as they offer a free subscription level that is usually sufficient. They also provide a easy-to-use WP plugin that allows … Read more

Setup SMTP setting in wordpress

WordPress uses PHPMailer class and has an action hook that you can use to configure it. For example: add_action( ‘phpmailer_init’, ‘cyb_smtp_config’ ); function cyb_smtp_config( $phpmailer ) { $phpmailer->IsSMTP(); $phpmailer->Host=”smtp.mailer.com”; $phpmailer->Port = 25; $phpmailer->Username=”username”; $phpmailer->Password = ‘password’; } Be sure that you need a custom SMTP connection instead of configuring the SMTP service in your hosting. … Read more

Can we validate user email changes?

You can use this hook to send a mail to your old email address <?php add_action( ‘profile_update’, ‘my_profile_update’, 10, 2 ); function my_profile_update( $user_id, $old_user_data ) { //Load new user data by uid and compare with old data // Email code about profile changes } ?> I think this should work for you.