Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['send-serial']))
- {
- add_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' );
- $user_id = get_current_user_id();
- $user = get_userdata( $user_id );
- $firstname = get_user_meta( $user_id, 'first_name', true );
- $lastname = get_user_meta( $user_id, 'last_name' , true );
- $tel = get_user_meta( $user_id, 'billing_phone' , true );
- $useremail = $user->user_email;
- $serailProduct = $_POST['serail-product'];
- $headers = array(
- 'From: xxxxx.xx@xxx.com',
- 'CC: xxxxx@gmail.com',
- 'CC: xxxxx@gmail.com'
- );
- $to = array(
- 'xxxxx.xxxx@gmail.com'
- );
- $subject = 'Serial Number';
- $body = '<p>Serial Number product ' . $serailProduct . '</p>
- <p>Name : ' . $firstname . ' ' . $lastname . '</p>
- <p>Email : ' . $useremail . '</p>
- <p>Tel : ' . $tel . '</p>';
- wc_add_notice('<strong>Success:</strong> Your Serial Product has sended ', 'inkfool');
- wp_mail( $to, $subject, $body, $headers );
- // Reset content-type to avoid conflicts -- https://core.trac.wordpress.org/ticket/23578
- remove_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' );
- function wpdocs_set_html_mail_content_type() {
- return 'text/html';
- }
- }
Add Comment
Please, Sign In to add comment