/** * Add content to the WC emails. * * @param object $order Order object. * @param bool $sent_to_admin Send to admin. * * @return string Billet instructions. */ function email_instructions($order, $sent_to_admin) { if ($sent_to_admin || 'on-hold' !== $order->status || 'boleto' !== $order->payment_method) { return; } $html = '<h2>' . __('Payment', $this->plugin_slug) . '</h2>'; $html .= '<p class="order_details">'; $message = sprintf(__('%sAttention!%s You will not get the ticket by Correios.', $this->plugin_slug), '<strong>', '</strong>') . '<br />'; $message .= __('Please click the following button and pay the Boleto in your Internet Banking.', $this->plugin_slug) . '<br />'; $message .= __('If you prefer, print and pay at any bank branch or home lottery.', $this->plugin_slug) . '<br />'; $html .= apply_filters('wcboleto_email_instructions', $message); $html .= '<br />' . sprintf('<a class="button" href="%s" target="_blank">%s</a>', WC_Boleto::get_boleto_url($order->order_key), __('Pay the Boleto →', $this->plugin_slug)) . '<br />'; $html .= '<strong style="font-size: 0.8em">' . sprintf(__('Validity of the Boleto: %s.', $this->plugin_slug), date('d/m/Y', time() + $this->boleto_time * 86400)) . '</strong>'; $html .= '</p>'; echo $html; }
/** * Get boleto URL from order key. * * @param string $code * * @return string */ function wc_boleto_get_boleto_url($code) { return WC_Boleto::get_boleto_url($code); }