Sie möchten eine Benachrichtigung sobald sich ein Benutzer auf Ihrer WordPress-WooCommerce-Seite registriert? In diesem Tutorial finden Sie die Antwort!
Funktioniert ab WordPress 5.2.3 und Woocommerce 3.6.4. Fügen Sie diese beiden Funktionen in die functions.php in wp-content/themes/myTheme ein.
/** * Notify admin when a new customer account is created */ add_action( 'woocommerce_created_customer', 'woocommerce_created_customer_admin_notification' ); function woocommerce_created_customer_admin_notification( $customer_id ) { wp_send_new_user_notifications( $customer_id, 'admin' ); } add_filter( 'wp_new_user_notification_email_admin', 'my_wp_new_user_notification_email_admin', 10, 3 ); function my_wp_new_user_notification_email_admin( $notification, $user, $blogname ) { $notification['headers'] = "From: Sender <user@domain.tld> \n\r cc: Receipient <user@domain.tld>"; return $notification; }
Hinterlasse einen Kommentar