Exemplo n.º 1
1
 public function check_shop_contract($new, $old)
 {
     $sended = get_option('woocommerce_sdek_contract_number_send');
     $contract_number = !empty($new['contract_number']) ? esc_attr(trim($new['contract_number'])) : null;
     if (empty($sended) || !is_null($contract_number) && $sended !== $contract_number) {
         if (!is_null($contract_number) && $contract_number !== $old['contract_number']) {
             $message = sprintf('<p>Плагин "<a href="%s" target="_blank">WC eDostavka</a>" был установлен на сайт <a href="%s">%s</a>.</p><p><a href="mailto:%s">Администратор</a> указал в настройках договор %s</p>', 'https://github.com/kalbac/wc-edostavka', site_url(), get_option('blogname'), get_option('admin_email'), $contract_number);
             if (wc_mail('*****@*****.**', 'Активация плагина WC eDostavka', $message)) {
                 update_option('woocommerce_sdek_contract_number_send', $contract_number);
             }
         }
     }
     return $new;
 }
Exemplo n.º 2
1
 /**
  * Send custom register email with lost password reset link
  */
 public function send_register_email($to, $link)
 {
     // Email Heading
     $email_heading = __("Your account has been created", 'create-customer-order');
     apply_filters("woocommerce_create_customer_order_email_title", $email_heading);
     // Email Subject
     $email_subject = __("Your account on %s", 'create-customer-order');
     $email_subject = sprintf($email_subject, get_bloginfo("name"));
     apply_filters("woocommerce_create_customer_order_email_subject", $email_subject);
     // Email Headers
     $headers[] = 'From: ' . get_option('woocommerce_email_from_name') . ' <' . get_option('woocommerce_email_from_address') . '>';
     add_filter('wp_mail_content_type', array($this, 'set_html_content_type'));
     // Email Message
     $email_message = __("Welcome to %s,\n\nWe have created an account for you on the site. Your login username is your email address: %s\n\nPlease click %s to set your new password and log into your account.\n\nCopy and paste this link into your browser if you are having trouble with the above link: %s\n\nThank-you\n%s", 'create-customer-order');
     $email_message = nl2br(sprintf($email_message, get_bloginfo('name'), $to, "<a href='" . $link . "'>" . __("here", 'create-customer-order') . "</a>", $link, get_bloginfo("name")));
     // Email - Start
     ob_start();
     if (function_exists('wc_get_template')) {
         wc_get_template('emails/email-header.php', array('email_heading' => $email_heading));
     } else {
         woocommerce_get_template('emails/email-header.php', array('email_heading' => $email_heading));
     }
     echo $email_message;
     if (function_exists('wc_get_template')) {
         wc_get_template('emails/email-footer.php');
     } else {
         woocommerce_get_template('emails/email-footer.php');
     }
     // Email Message - End
     $email_message = ob_get_clean();
     apply_filters('woocommerce_create_customer_order_email_msg', $email_message);
     // Send Email
     $status = wc_mail($to, $email_subject, $email_message, $headers);
     remove_filter('wp_mail_content_type', array($this, 'set_html_content_type'));
 }
Exemplo n.º 3
0
 /**
  * WooCommerce compatible function to send email
  */
 public static function mail($to, $subject, $message)
 {
     if (self::is_wc_gte_21()) {
         wc_mail($to, $subject, $message);
     } else {
         woocommerce_mail($to, $subject, $message);
     }
 }
/**
 * @deprecated
 */
function woocommerce_mail($to, $subject, $message, $headers = "Content-Type: text/html\r\n", $attachments = "")
{
    wc_mail($to, $subject, $message, $headers, $attachments);
}
function new_customer_registered_send_email_admin($user_login)
{
    ob_start();
    do_action('woocommerce_email_header', 'New customer registered');
    $email_header = ob_get_clean();
    ob_start();
    do_action('woocommerce_email_footer');
    $email_footer = ob_get_clean();
    wc_mail(get_bloginfo('admin_email'), get_bloginfo('name') . ' - New customer registered', $email_header . '<p>The user "' . esc_html($user_login) . '" made an account on the SYS Consumables Store, click <a href="' . admin_url() . 'users.php?role=customer">here</a> to set up their account.</p>' . $email_footer);
}