WordPress - WooCommerce API. Disable account setup email notification - php

I need to prevent the new "Your "shopname" account has been created!" email that gets sent when creating a user via the WooCommerce V3 REST API.
Do not send Woocommerce new customer email if a condition is true
Unfortunately that does not work in V3. The mail is still sent.
Has anyone been able to achieve this? There is no documentation about it. I need to create a custom email for users added in this way.

Was searching for this as well and removing the corresponding action woocommerce_created_customer_notification does the trick:
<?php
function disable_account_creation_email($email_class) {
remove_action('woocommerce_created_customer_notification', array($email_class, 'customer_new_account'), 10, 3);
}
add_action('woocommerce_email', 'disable_account_creation_email');

Related

Delay WooCommerce order processing mail

I have a question regards delaying a WooCommerce Out of the box email notifications. We use WooCommerce Shipment tracking and also Dokan plugins. And therefore we also have suborders: A suborder has also a tracking code. We provide that information in the parent order processing mail.
When a new order comes in, the shipment tracking is empty. I guess this is because the mail is sent too fast. I think this because of the reason, that when I send the processing mail from the admin backend manually, then I have all info. So the code is fully working. I only have the problem with the automatically sent mail from WooCommerce when a new order comes in.
I found this but there is no time delay: Send an Email notification to the admin for pending order status in WooCommerce
Also, I found this plugin code on Github from Damien Carbery.
But I don't know if I can just copy the code and make changes to it?
This is the part that I should change maybe:
'woocommerce_order_status_pending_to_processing' => array( 'WC_Email_New_Order', $this->default_defer_time ),

Woo commerce new user email

I wrote a custom plugin that handles login and registration for my WordPress Woocommerce site.
When a user registers via my custom form handler I would like to trigger Woocommerce to send the new user an email instead of using wp_mail. This way I reduce code redundancy, and all of the transactional emails can be formatted the same (they all have the same look and feel).
Is it possible to do so?
Try this:
$wc = new WC_Emails();
$wc->customer_new_account($user_id);
$customerID should be the ID of the newly created customer. Here you can find out everything about the WC_Email_Customer_New_Account class: https://docs.woocommerce.com/wc-apidocs/class-WC_Email_Customer_New_Account.html. Just place this code somewhere where it will run after the customer has been registered, so I assume somewhere where you would have placed the wp_mail functions. Let me know if this helped :)

Woocommerce Order Completed Email notification

I am trying to find a way to send out an email once the order has been completed within WooCommerce store. How would I go about sending an auto email once the product/order has been ticked finish.
Thanks
WooCommerce automatically send the processing email to user when you place any order and also send the mail to admin for new order you have to do nothing. Are you getting any type of error or something? because after installation all thing works automatically.

How to pass email address to webhook from MailChimp

I am building a web app in PHP that subscribes and unsubscribes members from a MailChimp list via the API.
What I'm trying to add (and having extreme difficulty with) is use the MailChimp web hook features to pass the email address of someone that has unsubscribed through MailChimp to the hook that I have created on my app to that it will then update the database.
The app expects to receive the below URL to update the database
domain.com/includes/mailchimp-update.php?email=mail#domain.com
I am unsure as how to get that from the MailChimp web hook, and cannot find anything on here about it or on MailChimp, and their live help was not that helpful.
Just in case anyone else is struggling with this, here is how I resolved it.
Using the mailchimp webhook passes an array of data via POST. To pull the email address from the array, simply use.
$email = $_POST ['data']['email'];

bulk invite in Magento

How would I go about creating a bulk invite feature in Magento?
The steps would be:
An admin fills in a form with a comma separated list of emails.
Email recipient gets an email containing a link to the client registration page of Magento. In Magento this would be the page "/customer/account/create/".
Is there a free module that lets me do this? If not, how can I get started in adding a page in the admin screen which would allow me to send emails?
Thanks.
I ended up creating my own module which sends email during a form post. I got my ideas here:
Send email via Magento

Categories