Когда мой заказ изменил свой статус с незавершенного процесса, никакие электронные письма не являются триггерами. Я проверил код плагинаУведомление по электронной почте Woocommerce
public function __construct() {
$this->id = 'customer_processing_order';
$this->title = __('Processing order', 'woocommerce');
$this->description = __('This is an order notification sent to the customer after payment containing order details.', 'woocommerce' );
$this->heading = __('Thank you for your order', 'woocommerce');
$this->subject = __('Your {blogname} order receipt from {order_date}', 'woocommerce');
$this->template_html = 'emails/customer-processing-order.php';
$this->template_plain = 'emails/plain/customer-processing-order.php';
// Triggers for this email
add_action('woocommerce_order_status_pending_to_processing_notification', array($this, 'trigger'));
// Call parent constructor
parent::__construct();
}
public function trigger($order_id) {
if ($order_id) {
$this->object = wc_get_order($order_id);
$this->recipient = $this->object->billing_email;
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->replace['order-number'] = $this->object->get_order_number();
}
if (! $this->is_enabled() || ! $this->get_recipient()) {
return;
}
wp_mail($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
}
Я положил тестовую почту в функцию, чтобы проверить вызванную функцию триггера. но в любом случае это не работает. но другие электронные письма, такие как забытый пароль, никаких уведомлений об электронных почтовых сообщениях работают нормально, только порядок изменения статуса почты не работает. Извините за мой плохой английский. Заранее благодарим за помощь.
И вообще, я действительно обескураживаю любые изменения в коде плагинов. Все, что вам нужно достичь, должно быть закодировано под вашей настроенной дочерней темой. –
Благодарим вас за быстрый ответ. Я использую paypal sanbox для проверки платежей после завершения платежа. Он должен автоматически отправлять почту автоматически !. Это ничего не будет звать. Но если я попытаюсь отправить вручную, он вызывает соответствующую почту. –
Вы установили IPN? см. Здесь: https://docs.woocommerce.com/document/paypal-standard/#section-19 и здесь: https://docs.woocommerce.com/document/paypal-standard/#section-6 –