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>';
}

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