Seems I’ve managed to find the solution. $mailer = $woocommerce->mailer();
must be called before the Get mail template
function send_activation_link() {
global $woocommerce;
//My other code here....
$mailer = $woocommerce->mailer();
ob_start();
// Get mail template
woocommerce_get_template('emails/customer-reset-password-link.php', array(
'user_login' => $user_login,
'blogname' => $blogname,
'email_heading' => $email_heading,
'key' => $key
));
// Get contents
$message = ob_get_clean();
$mailer->send( $user_email, $subject, $message);
}
add_action( 'init', 'send_activation_link');
Related Posts:
- How to create a flexible abstraction for WP_Query?
- custom XMLRPC method plus authentication of user & WooCommerce order
- Adding callback function for wp_ajax_ has no effect
- How to add meta boxes to the ‘Add new post’ screen?
- Load WooCommerce templates from my plugin folder first
- In woocommerce who is responsible for sending the receipt email?
- Append varible to url or set session
- Plugin for Android Marketplace downloads?
- change add to cart button link [closed]
- WooCommerce currency converter support [closed]
- Woocommerce – looping product images
- WooCommerce custom payment gateway
- How to remove a class [closed]
- woocommerce features to add product along with link
- How to create an API for my plugin?
- Plugins in symlinked directories?
- How to use PanelColorSettings in custom Gutenberg block?
- Is there a way for a plug-in to get it’s own version number?
- How to add tab which is visible only in admin side of product in woocommerce? [closed]
- Loading external page template and enqueue script from plugin causes 403 forbidden error
- Where the Nickname is being used in WordPress
- Hook the Keydown Event in the TinyMCE Post Editor
- Unable to write test cases for a WordPress plugin using PHPUnit and WP-CLI
- WordPress Settings API: saving multiple rows of similar data
- Modify how gallery.js builds the shortcode [gallery ...] in tinyMCE?
- How to use is_multisite() in a must-use-plugin?
- Adding dynamic section to WordPress
- why creating tables using $wpdb is not being executed while installing plugins?
- How to update the language used by wordpress from a plugin
- Yoast SEO blocking/re-initialising longer running process
- Add Fields with Sub-Fields to WP Job Manager
- Modify a Free Plugin available on wordpress.org & include with my Premium Theme? [closed]
- template_redirect not being called when using ajax
- How to correctly detect accessing wp-content/uploads?
- How to create custom embed block in gutenberg wordpress
- How do I write a shortcode that opens and closes?
- How can sanitize $_FILES[‘haq_slider’] field
- Registering and using actions which return results in a Plugin class
- How to trigger $_GET request within admin plugin page?
- Plugin developement and SVN
- React JSX in WordPress Plugin Development
- Custom attribute type not displaying terms in edit product – WooCommerce
- How do I add a prefix when a user registers
- My plugin wants to update another plugin
- Short code not working in boostrap modal dont no why?
- how to get link of added document with a post
- Using SVN to upload plugin created with gutenberg blocks
- Doubts about the use of metadata and how this can affect performance on WordPress
- How can I replace content in the WP Admin area before an admin page is rendered?
- update_post_meta not working in a loop
- When is the proper time to minify css and js with git workflow?
- Get draggable widgets on Edit Post page
- Plugin that saves form data
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- update your existing plugin’s WordPress compatibility
- jquery & ajax sending data to php
- breadcrumb need to show all pages and subpages
- Widget’s container?
- Can I use %category% like Templates in my Plugin?
- How to get the url of logo image?
- Plugin path comes wrongly
- Replace first occurence of a word with link [closed]
- Converting core modification to a plugin
- WordPress Widget Not Saving Instance
- Adding filter to the title without affecting the menu title
- Different registration form for different roles
- My plugin does not install correctly if a previous version is still installed
- How can the_excerpt (or equivalent) be called on a category description?
- Plugin Creation: Overriding upload_max_size and post_max_size
- Problems with wierd characters and my plugin
- How to call a function from a shortcode function in an oop plugin
- How to access index file in Block Themes?
- wp_new_user_notifications to notify user and admin about new user registration
- How to solve conflict with scripts?
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- How to create a custom post-new.php page for plugin , no wp menu
- How to create a custom WordPress page with my plugin?
- wp_insert_post not inserting post from XML
- How to re-render inspector controls?
- Access “wp site health info” data from plugin
- Why User_login key doesn’t work with wp_update_user()
- Shortcode content is not showing. Only the [shortcode-tag] is showing
- Change Woo Custom Endpoint Titles from a Plugin
- How to remove the WooCommerce Product->Category thumbnail from admin [closed]
- Is it possible to replace MySQL with JSON files for WordPress
- Plugin Development – Call to undefined function comment_exists()
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- WordPress doesn’t create table on plugin activation
- Create Customization panel for Plugins not for theme
- How is construct function working even when variable is assigned null value?
- Get input form data posted by users
- Custom signature appears twice on page
- Declaring a new woo commerce product type i get this error
- wp_mail links are dead
- List Available Templates for Current Theme in a Plugin
- Adding Third Post Box Column: postbox-container-3
- Create plugin with form in post and submit it to specific form
- Storing values in Post Meta vs new tables
- Custom Post Types in plugins?