Custom Email via Hook only for completed order

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 sent from WordPress has HTML tags

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 do I update user email from frontend input field?

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.

User Without Email?

It’s possible, just not so easily via the Users page without some hackery. The WordPress Function wp_create_user will let you insert users without email addresses, so a little custom plugin to accept a login name and password, and a call to wp_insert_user or wp_update_user should work for you. Unfortunately I don’t have time to code … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)