How to fetch Email addres of an author via ID?
Use get_userdata() to get a user object, and the email address will be the email property: $userdata = get_userdata( $user_id ); if ( ! $userdata ) { return false; } echo $userdata->email;
Use get_userdata() to get a user object, and the email address will be the email property: $userdata = get_userdata( $user_id ); if ( ! $userdata ) { return false; } echo $userdata->email;
WordPress emails are not delivered if the recipient email address has a non-traditional domain extension
Access custom meta_data in processing order email
If your code works but it works for all emails you can add a check for only completed orders like this add_action( ‘woocommerce_email_before_order_table’, ‘mm_email_before_order_table’, 10, 4 ); function mm_email_before_order_table( $order, $sent_to_admin, $plain_text, $email ) { // if not completed order, exit if ($email->id != ‘customer_completed_order’) return; echo ‘<p>extra information</p>’; }
email saying that was not possible to send the email
Have you disabled EasyWP SMTP or completely deleted it? If you’ve deleted it and it still shows the old from address, most likely some database entries are leftover. To fix: Depending on how you’ve setup Post SMTP mailer, try changing the From address details in this plugin’s settings Manually change the From address in WordPress … Read more
The default content type is ‘text/plain’ which does not allow using HTML. You can set the content type of the email by including a header like “Content-type: text/html” $headers=”Content-type: text/html;charset=utf-8″ . “\r\n”; $headers .= ‘From: XXXXXX.com <[email protected]>’ . “\r\n”; $subject=”Registration from xxxxx.com” . “\r\n”; $message = $result_email_text; wp_mail($_POST[‘admin_email’], $subject, $message, $headers ); Or you can … Read more
How to recover one of WP email addresses?
I had the same issue. I finally succeed to display the message with proper line breaks by surrounding the body of the message $wp_new_user_notification_email[‘message’],in your case, with html tags (html, head, body) and filtering it with nl2br. Hope it will help.
You can diagnose error while updating user email. $user_data = wp_update_user( array( ‘ID’ => $user_id, ‘user_email’ => $email ) ); if ( is_wp_error( $user_data ) ) { // There was an error; possibly this user doesn’t exist. echo ‘Error.’; } else { // Success! echo ‘User profile updated.’; } Might it can help you.