Send a custom WooCommerce email when custom order change [closed]

I think you need do two changes: Add a filter to woocommerce_email_actions that adds the action hook which should trigger the notification: function add_ready_to_ship_woocommerce_email_action( $email_actions ) { $email_actions[] = ‘woocommerce_order_status_ready-to-ship’; return $email_actions; } add_filter( ‘woocommerce_email_actions’, ‘add_ready_to_ship_woocommerce_email_action’ ); Change the trigger hook in the email class (add a _notification suffix): // Trigger on new paid orders … Read more

Can I mass change all admin emails for a multisite instance?

Okay so thanks to the suggestion from Rup I got this to work and apply to all my sites locally (will double check this before using on live!) $blogs = get_sites([‘public’ => 1, ‘orderby’ => ‘registered’, ‘order’ => ‘DESC’, ‘number’ => 1000]); foreach($blogs as $blog) { $bid = $blog->blog_id; switch_to_blog($bid); update_option( ‘admin_email’, ‘[email protected]’ ); update_option( … Read more

Send email button in custom post type backend

Solved this using AJAX. Here is my updated code: <?php add_action(‘wp_ajax_quote_email_pdf’, ‘quote_email_pdf’); function quote_email_pdf() { wp_mail( $to, $subject, $message, $headers, $attachments ); die(); } ?> <button class=”button” id=”downloadQuote”>Send email</button> <script> jQuery(document).ready(function($){ const fullName = $(‘#quoteFullName’).text(); const emailAddress = $(‘#quoteEmail a’).text(); $(‘#downloadQuote’).click(function(e){ e.preventDefault(); $.ajax({ url: sf_admin_ajax.sf_admin_ajax_url, type: ‘POST’, data: { action: ‘quote_email_pdf’, emailAddress: emailAddress, fullName: fullName … Read more

Mechanism to send to users of secured WordPress install new notifications by SMS or email?

I’d say there’s three specific requirements here; Allow users to choose notification times, timezone aware Hook into transition_post_status to listen up for new posts, and then take action Find a decent SMS API For 1), hook into show_user_profile to output your time picker field(s), and personal_options_update to save them. You could detect the user’s timezone … Read more

Send email only upon draft

$post_id is an integer (just the post id) and not a post object (the whole post with id,status,title …) so globalize the $post object and check the status from there eg: function er_send_email_on_post_draft_save( $post_id ) { global $post; //verify post is not a revision if ( $post->post_status == ‘draft’ ) { $post_title = get_the_title( $post_id … Read more