草庐IT

php - WooCommerce 已取消电子邮件通知,订单过期时未发送

coder 2024-04-30 原文

我已经在 woocommerce 中设置了库存,并配置了如果付款没有完成几分钟后自动取消订单的时间,它工作正常,在那段时间后订单被取消,但没有生成电子邮件。我已检查电子邮件地址并将模板复制到我的主题,但尚未进行任何更改,

要接收邮件,如何解决这个问题?

注意:正在接收新订单电子邮件,但未取消该订单。

这是 Woocomerce 的状态:

### WordPress Environment ###

Home URL: https://www.lfp-store.de
Site URL: https://www.lfp-store.de
WC Version: 3.2.5
Log Directory Writable: ✔
WP Version: 4.9.1
WP Multisite: -
WP Memory Limit: ❌40 MB - We recommend setting the PHP memory limit (memory_limit) to at least 64 MB. See: PHP increase memory limit
WP Debug Mode: -
WP Cron: ✔
Language: de_DE_formal

### Server Environment ###

Server Info: Apache
PHP Version: 06/05/32
PHP Post Max Size: 6 MB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.38.0
OpenSSL / 1.0.1t

SUHOSIN Installed: -
MySQL Version: ❌5.5.58 - We recommend at least MySQL version 5.6. See: WordPress Requirements
Max Upload Size: 64 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

### Database ###

WC Database Version: 3.2.5
WC Database Prefix: hcQxuuYa
MaxMind GeoIP Database: ✔
Total database size: 8.75MB
Database data size: 6.55MB
Database index size: 2.20MB
hcQxuuYawoocommerce_sessions: Data: 0.05MB + Index: 0.00MB
hcQxuuYawoocommerce_api_keys: Data: 0.00MB + Index: 0.00MB
hcQxuuYawoocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.01MB
hcQxuuYawoocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB
hcQxuuYawoocommerce_order_items: Data: 0.01MB + Index: 0.01MB
hcQxuuYawoocommerce_order_itemmeta: Data: 0.09MB + Index: 0.07MB
hcQxuuYawoocommerce_tax_rates: Data: 0.00MB + Index: 0.01MB
hcQxuuYawoocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB
hcQxuuYawoocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB
hcQxuuYawoocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.01MB
hcQxuuYawoocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB
hcQxuuYawoocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB
hcQxuuYawoocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB
hcQxuuYawoocommerce_log: Data: 0.02MB + Index: 0.02MB
hcQxuuYacommentmeta: Data: 0.00MB + Index: 0.01MB
hcQxuuYacomments: Data: 0.03MB + Index: 0.02MB
hcQxuuYaduplicator_packages: Data: 0.02MB + Index: 0.02MB
hcQxuuYalayerslider: Data: 0.07MB + Index: 0.00MB
hcQxuuYalayerslider_revisions: Data: 0.02MB + Index: 0.00MB
hcQxuuYalinks: Data: 0.00MB + Index: 0.00MB
hcQxuuYaoptions: Data: 0.58MB + Index: 0.12MB
hcQxuuYapostmeta: Data: 2.82MB + Index: 1.50MB
hcQxuuYaposts: Data: 2.69MB + Index: 0.22MB
hcQxuuYatermmeta: Data: 0.01MB + Index: 0.02MB
hcQxuuYaterms: Data: 0.01MB + Index: 0.03MB
hcQxuuYaterm_relationships: Data: 0.03MB + Index: 0.06MB
hcQxuuYaterm_taxonomy: Data: 0.01MB + Index: 0.01MB
hcQxuuYausermeta: Data: 0.05MB + Index: 0.03MB
hcQxuuYausers: Data: 0.00MB + Index: 0.01MB
hcQxuuYayoast_seo_links: Data: 0.02MB + Index: 0.02MB
hcQxuuYayoast_seo_meta: Data: 0.02MB + Index: 0.00MB

### Post Type Counts ###

attachment: 300
avia_framework_post: 29
nav_menu_item: 46
page: 22
portfolio: 1
post: 1
product: 146
product_variation: 1023
revision: 441
shop_coupon: 61
shop_order: 87

### Security ###

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

### Active Plugins (8) ###

Loco Translate: by Tim Whitlock - 2.0.17
UpdraftPlus - Backup / Restore: by UpdraftPlus.Com
David Anderson - 1:13:16

Vendidero Helper: from Vendidero - 1.1.4
WooCommerce Germanized Pro: from Vendidero - 1.8.3
WooCommerce Germanized: from Vendidero - 1.9.6
Instant Banking for WooCommerce: by Sven Wagener - 1.3.0
WooCommerce: by Automattic - 3.2.5 - 3.2.6 is available
Yoast SEO: by Team Yoast - 5.9.3

### Settings ###

API Enabled: ✔
Force SSL: ✔
Currency: EUR (€)
Currency Position: right_space
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated -2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)


### WC Pages ###

Shop-Basis: # 578 - / shop /
Warenkorb: # 507 - / cart-2 /
Kasse: # 28 - / checkout-2 /
Mein Konto: # 29 - / my-account /
Geschäftsbedingungen: # 693 - / general_agreement /

### Theme ###

Name: Enfold Child
Version: 1.0
Author URL: http://www.kriesi.at
Child Theme: ✔
Parent Theme Name: enfold
Parent Theme Version: 4.2
Parent Theme Author URL: https://kriesi.at
WooCommerce Support: ✔

### Templates ###

Overrides: enfold-child / woocommerce / emails / admin-canceled-order.php
enfold-child / woocommerce / emails / admin-new-order.php
enfold-child / woocommerce / emails / customer-on-hold-order.php

最佳答案

要强制发送“已取消”电子邮件通知,您可以尝试以下操作:

add_action('woocommerce_order_status_changed', 'cancelled_order_email_notifications', 10, 4 );
function cancelled_order_email_notifications( $order_id, $old_status, $new_status, $order ){
    // Only when order status is changed to 'cancelled'
    if ( $new_status != 'cancelled' ) return;

    // Send cancelled email notification
    WC()->mailer()->get_emails()['WC_Email_Cancelled_Order']->trigger( $order_id ); 
}

代码进入您的事件子主题(或事件主题)的 function.php 文件。

经过测试并有效。

Notes:
- This email notification is only sent to admin.
- Copying the related template file to your child theme will not help to send this notification.

关于php - WooCommerce 已取消电子邮件通知,订单过期时未发送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48181814/

有关php - WooCommerce 已取消电子邮件通知,订单过期时未发送的更多相关文章

  1. jquery - 我的 jquery AJAX POST 请求无需发送 Authenticity Token (Rails) - 2

    rails中是否有任何规定允许站点的所有AJAXPOST请求在没有authenticity_token的情况下通过?我有一个调用Controller方法的JqueryPOSTajax调用,但我没有在其中放置任何真实性代码,但调用成功。我的ApplicationController确实有'request_forgery_protection'并且我已经改变了config.action_controller.consider_all_requests_local在我的environments/development.rb中为false我还搜索了我的代码以确保我没有重载ajaxSend来发送

  2. ruby - 使用 Ruby 通过 Outlook 发送消息的最简单方法是什么? - 2

    我的工作要求我为某些测试自动生成电子邮件。我一直在四处寻找,但未能找到可以快速实现的合理解决方案。它需要在outlook而不是其他邮件服务器中,因为我们有一些奇怪的身份验证规则,我们需要保存草稿而不是仅仅发送邮件的选项。显然win32ole可以做到这一点,但我找不到任何相当简单的例子。 最佳答案 假设存储了Outlook凭据并且您设置为自动登录到Outlook,WIN32OLE可以很好地完成此操作:require'win32ole'outlook=WIN32OLE.new('Outlook.Application')message=

  3. ruby - 是否可以在不实际发送或读取数据的情况下查明 ruby​​ 套接字是否处于 ESTABLISHED 或 CLOSE_WAIT 状态? - 2

    s=Socket.new(Socket::AF_INET,Socket::SOCK_STREAM,0)s.connect(Socket.pack_sockaddr_in('port','hostname'))ssl=OpenSSL::SSL::SSLSocket.new(s,sslcert)ssl.connect从这里开始,如果ssl连接和底层套接字仍然是ESTABLISHED,或者它是否在默认值7200之后进入CLOSE_WAIT,我想检查一个线程几秒钟甚至更糟的是在实际上不需要.write()或.read()的情况下关闭。是用select()、IO.select()还是其他方法完成

  4. ruby-on-rails - 验证电子邮件地址是 Paypal 用户 - 2

    我想验证一个电子邮件地址是否是PayPal用户。是否有API调用来执行此操作?是否有执行此操作的ruby​​库?谢谢 最佳答案 GetVerifiedStatus来自PayPal'sAdaptiveAccounts平台会为您做这件事。PayPal没有任何codesamples或SDKs用于Ruby中的自适应帐户,但我确实找到了编写codeforGetVerifiedStatusinRuby的人.您需要更改该代码以检查他们拥有的帐户类型的唯一更改是更改if@xml['accountStatus']!=nilaccount_status

  5. ruby - 安装 gem 时未初始化的常量 Psych::Syck - 2

    我将gem推送到ruby​​gems.org,当我执行“geminstall(gem)”时出现此错误:ERROR:Whileexecutinggem...(NameError)uninitializedconstantPsych::Syck我可以执行“gembuild(gem).gemspec”来生成本地gem,然后geminstall(gem).gem并且安装正常。我还可以将gem放入我的Rails应用程序的Gemfile中,并带有指向Github存储库的指针,这也可以。我试过在多台计算机上安装gem(来自ruby​​gems.org,它们都遇到相同的错误。我不知道是什么原因导致从r

  6. ruby-on-rails - Ruby on Rails - 需要在每周的特定时间将消息发送到电子邮件 - 2

    我想知道我应该如何着手这个项目。我需要每周向人们发送一次电子邮件。但是,这必须在每周的特定时间自动生成并发送。编码有多难?我需要知道是否有任何书籍可以提供帮助,或者你们中的任何人是否可以指导我。它必须使用ruby​​onrails进行编程。因此有一个网络服务和数据库集成。干杯 最佳答案 为什么这么复杂?您只需安排工作。您可以使用Delayed::Job例如。Delayed::Job让您可以使用run_at符号在特定时间安排作业,如下所示:Delayed::Job.enqueue(SendEmailJob.new(...),:run_

  7. ruby - 如何理解 Ruby 中的发送者和接收者? - 2

    我很难理解Ruby中sender和receiver的实际含义。它们一般是什么意思?到目前为止,我只是将它们理解为方法调用和获取其返回值的调用。但是,我知道我的理解还远远不够。谁能给我一个Ruby中发送者和接收者的具体解释? 最佳答案 面向对象中的一个核心概念是消息传递和早期概念化,这在很大程度上借鉴了计算的Actor模型。艾伦·凯(AlanKay)创造了面向对象一词并发明了最早的OO语言之一SmallTalk,他拥有voicedregretatusingatermwhichputthefocusonobjectsinsteadofo

  8. ruby - 动态扩展现有方法或覆盖 ruby​​ 中的发送方法 - 2

    假设我们有A、B、C类。Adefself.inherited(sub)#metaprogramminggoeshere#takeclassthathasjustinheritedclassA#andforfooclassesinjectprepare_foo()as#firstlineofmethodthenrunrestofthecodeenddefprepare_foo#=>prepare_foo()neededhere#somecodeendendBprepare_foo()neededhere#somecodeendend如您所见,我正在尝试将foo_prepare()调用注入

  9. ruby-on-rails - 如何通过 POST 发送多个相同的键/参数? - 2

    如果我必须在一个HTTP请求中发送一堆post参数,所有这些参数都具有相同的名称,我该如何构建要发布的data对象?想象一个带有一些复选框的表单,它们都具有相同的name属性但具有不同的值(如果它们被选中):我想用ruby​​构建它(但它需要根据在表单上选择的内容动态创建):data={"color"=>"red","color"=>"green","color"=>"blue"}然后将数据发送到某个URL:Net::HTTP.post_form(url,data)我无法控制接收端,所以我必须发送它期望接收的参数。怎么办? 最佳答案

  10. 常见网络安全产品汇总(私信发送思维导图) - 2

    安全产品安全网关类防火墙Firewall防火墙防火墙主要用于边界安全防护的权限控制和安全域的划分。防火墙•信息安全的防护系统,依照特定的规则,允许或是限制传输的数据通过。防火墙是一个由软件和硬件设备组合而成,在内外网之间、专网与公网之间的界面上构成的保护屏障。下一代防火墙•下一代防火墙,NextGenerationFirewall,简称NGFirewall,是一款可以全面应对应用层威胁的高性能防火墙,提供网络层应用层一体化安全防护。生产厂家•联想网御、CheckPoint、深信服、网康、天融信、华为、H3C等防火墙部署部署于内、外网编辑额,用于权限访问控制和安全域划分。UTM统一威胁管理(Un

随机推荐