Last active
May 29, 2019 10:30
-
-
Save filipecsweb/8c0773c35391540fdf1f to your computer and use it in GitHub Desktop.
Overwrite subject line of the WooCommerce transactional e-mails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sobrescrever assunto dos emails transacionais do WooCommerce. | |
* | |
* Tags possíveis para usar como parâmetro em add_filter(): | |
* | |
* woocommerce_email_subject_new_order = Novo pedido | |
* woocommerce_email_subject_customer_processing_order = Processando pedido | |
* woocommerce_email_subject_customer_completed_order = Pedido concluído | |
* woocommerce_email_subject_customer_invoice = Fatura do cliente | |
* woocommerce_email_subject_customer_note = Nota do cliente | |
* woocommerce_email_subject_low_stock = Notificações de baixo estoque | |
* woocommerce_email_subject_no_stock = Notificações de item em falta no estoque | |
* woocommerce_email_subject_backorder = Pedido de produto sob encomenda | |
* woocommerce_email_subject_customer_new_account = Nova conta | |
* woocommerce_email_subject_correios_tracking = Template criado pelo plugin WooCommerce Correios | |
* | |
* @return string $subject Nova linha de assunto. | |
*/ | |
function change_transactional_email_subject( $subject, $order ) { | |
$subject = sprintf( ' %s, recebemos seu pedido #%s em %s', $order->billing_first_name, $order->id, date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); | |
return $subject; | |
} | |
add_filter( 'woocommerce_email_subject_new_order', 'change_transactional_email_subject', 100, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment