Based on your question, you could simply call the WordPress function
wp_mail( $to, $subject, $message, $headers );
when your var $user_progress['completion_percentage']
equal 100 %.
<?php
if( $user_progress['completion_percentage'] === 100 ) {
// Complete your variables with original code
$to = "[email protected]";
$subject = __("New user registration", "yourdomain");
$headers = array('Content-Type: text/html; charset=UTF-8');
$message = "A new user have completed his/her profile" . $user['id'];
// Send the email
wp_mail( $to, $subject, $message, $headers );
}
?>
Source : https://developer.wordpress.org/reference/functions/wp_mail/
Related Posts:
- Get a list of all available fields in the User Profile
- How to add first name & last name to default registration form?
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- How to add custom fields to my custom registration form
- How to hide unused profile fields?
- How to force field validation first, then its values saved durning edit profile?
- Hide tab Buddypress profile for visitors, not logged in users
- Add Link to Users List (Backend) to open each users front-end profile
- Showing user profile data on front-end
- Advantages and disadvantages of using automatic-feed-links
- How to change the markup WordPress inserts for post images
- When tax_query used, results disappear (0 =1 produced)
- Targeting specific menu with wp_nav_menu_items
- wp_get_attachment_image returns different image size
- Limit the length of the Author Profile Biographical Text
- Convert hyphen to underscore in permalinks
- disable comments if array exists
- wp_mail not running inside Cron
- Remove images from get_the_excerpt
- Remove product description from product archive page
- Logging in redirects to correct page but shows logged out content until forced refresh
- What is the criteria for pluggable functions?
- How can I stop a function from encoding an entity?
- Theme-Config tab in admin Pannel?
- Display more recent and less recent posts in same category
- Increment price for Woocommerce Minicart [closed]
- Change woocommerce products weight varation based its product category or tags? [closed]
- Function to “Press Update Button” on all posts
- Change WP attachment name to postid during upload only for post type
- Completely disable RSS feeds on WP 5.5.2 and show a 404 page instead of die();
- Check if row exists before inserting
- Missing argument 2 for a custom function widgets_init
- How to target only the front page (not subsequent paginated pages) in theme/plugin?
- Removing the main link to Jetpack from the menu
- Defining a global array in functions.php?
- Get the 5 lastest Featured Posts from a category
- Set quantity of woocommerce product on page visit [closed]
- get_post_type() in in_array doesn’t work for some reason
- Is it possible to change any of the HTML/URL returned from the_category()
- How to remove set_post_thumbnail_size() in child themes?
- Activate small php condition at footer over page template
- How to insert custom widget in custom sidebar in theme activation?
- Fatal error: Cannot redeclare when switching themes
- How to load jQuery in the footer – nothing works for me
- HTTP_HOST changing in functions.php
- 404 redirect to previous category
- Specify number of posts for sub-category page
- how to en-queue jQuery to load before the tag
- comments_popup_link without echo?
- Can’t filter wp_get_attachment_link
- Impossible to call wordpress function inside an include?
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- Remove a category from a post when saving a new post
- Want to dequeue all the CSS and JS from /wp-content/uploads/xyz-folder
- Scripts not loading when using the wp_enqueue_scripts action
- is there a way to remove featured image from blog page and single page
- Include the post type before the title of search results
- Adding additional roles on registration
- add referrer to woo
- overwrite code snippet from parent to child theme
- Get Attachment Category Name
- Problem with custom function when I go back with the browser
- If no author posts, echo out some text
- How i can get the URL?
- Show metadata in users.php – wordpress
- Add version # to wp_register_style function
- How to remove font awesome from loading in wp theme
- Gravity Forms – Custom Merge Tag Convert date_created to Local/WordPress Time?
- Add custom css file after plugin css with WordPress Child Theme functions.php
- Remove check boxes and its label from screen option for custom role
- Removing comment lines from all enqueued js files using a filter function
- Fatal error: Call to undefined function load_theme_textdomain() in /var/www/vhosts/61/151172/webspace/httpdocs/wp-includes/functions.php on line 5
- Remove clickable Link of WordPress Site Logo from Woocommerce Single Product page
- Only display table in the_content() in canonical page
- Button click counter for login user
- Auto copy value from specific user meta field to another field
- Variable function names
- Route wordpress with template
- Change is_front_page() to is_page() to display ‘hero’ on entire site?
- How to override or change function in form.php in a plugin
- Some code is added automatically to my site’s header – what is it?
- Function causes edit_post_link to link to the wrong post
- To make some div display for a longer time
- Getting back a blank WordPress site following functions code edit
- Insert menu into theme location depending on user logged in/out status
- Add functionality to post editor
- Define an extra field for all pages (with no plugin?)
- Cant use php fopen() function in functions.php
- Set thumbnail from URL, by grabbing image in functions.php
- admin-ajax.php nulls all php variables
- How to remove “login to reply” from individual comments [duplicate]
- Why functions metaboxes is causing White Screen in Admin [closed]
- Rename file after title , one small problem
- Adding function to function.php error 505 [closed]
- image_size with respect to aspect ratios
- Problem with woocommerce recalculating tax on completed orders
- Is it possible to set the first image from a gallery as the product image, rather than the featured image?
- Simple way to make most of my site private
- Uploading images via ACF update_field function
- Store the query string parameter in session value and use it once user logged in