コード例 #1
0
    $modified_date = current_time('mysql');
    $order_id = '0';
    $customer_id = $current_user->ID;
    $billing_first_name = $current_user->user_login;
} else {
    $billing_email = $order->billing_email;
    $order_date = $order->order_date;
    $modified_date = $order->modified_date;
    $order_id = $order->id;
    $customer_id = $order->__get('user_id');
    $billing_first_name = $order->billing_first_name;
}
$query_args = array('id' => urlencode(base64_encode(!empty($customer_id) ? $customer_id : 0)), 'email' => urlencode(base64_encode($billing_email)));
$unsubscribe = esc_url(add_query_arg($query_args, get_permalink(get_option('ywrr_unsubscribe_page_id'))));
$unsubscribe_link = array_key_exists($template, YITH_WRR()->_email_templates) || defined('YITH_WCET_PREMIUM') && get_option('ywrr_mail_template_enable') == 'yes' ? '' : '<a href="' . $unsubscribe . '">' . get_option('ywrr_mail_unsubscribe_text') . '</a>';
$review_list = YITH_WRR()->ywrr_email_items_list($item_list, $template);
$find = array('{customer_name}', '{customer_email}', '{site_title}', '{order_id}', '{order_date}', '{order_date_completed}', '{order_list}', '{days_ago}', '{unsubscribe_link}');
$replace = array('<b>' . $billing_first_name . '</b>', '<b>' . $billing_email . '</b>', '<b>' . get_option('blogname') . '</b>', '<b>' . $order_id . '</b>', '<b>' . $order_date . '</b>', '<b>' . $modified_date . '</b>', $review_list, '<b>' . $days_ago . '</b>', $unsubscribe_link);
$lang = get_post_meta($order_id, 'wpml_language', true);
$mail_body = str_replace($find, $replace, apply_filters('wpml_translate_single_string', get_option('ywrr_mail_body'), 'admin_texts_ywrr_mail_body', 'ywrr_mail_body', $lang));
if (defined('YITH_WCET_PREMIUM') && get_option('ywrr_mail_template_enable') == 'yes') {
    do_action('woocommerce_email_header', $email_heading, $email);
} else {
    do_action('ywrr_email_header', $email_heading, $template);
}
?>

    <p><?php 
echo wpautop($mail_body);
?>
</p>
コード例 #2
0
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
$query_args = array('page' => isset($_GET['page']) ? $_GET['page'] : '', 'tab' => 'howto');
$howto_url = esc_url(add_query_arg($query_args, admin_url('admin.php')));
$placeholders_text = __('Allowed placeholders:', 'yith-woocommerce-review-reminder');
$ph_reference_link = ' - <a href="' . $howto_url . '" target="_blank">' . __('More info', 'yith-woocommerce-review-reminder') . '</a>';
$ph_site_title = ' <b>{site_title}</b>';
$ph_customer_name = ' <b>{customer_name}</b>';
$ph_customer_email = ' <b>{customer_email}</b>';
$ph_order_id = ' <b>{order_id}</b>';
$ph_order_date = ' <b>{order_date}</b>';
$ph_order_date_completed = ' <b>{order_date_completed}</b>';
$ph_order_list = ' <b>{order_list}</b>';
$ph_days_ago = ' <b>{days_ago}</b>';
$ph_unsubscribe_link = ' <b>{unsubscribe_link}</b>';
return array('mail' => array('section_general_settings_videobox' => array('name' => __('Upgrade to the PREMIUM VERSION', 'yith-woocommerce-review-reminder'), 'type' => 'videobox', 'default' => array('plugin_name' => __('YITH WooCommerce Review Reminder', 'yith-woocommerce-review-reminder'), 'title_first_column' => __('Discover the Advanced Features', 'yith-woocommerce-review-reminder'), 'description_first_column' => __('Upgrade to the PREMIUM VERSION of YITH WooCommerce Review Reminder to benefit from all features!', 'yith-woocommerce-review-reminder'), 'video' => array('video_id' => '118824650', 'video_image_url' => YWRR_ASSETS_URL . '/images/yith-woocommerce-review-reminder.jpg', 'video_description' => __('YITH WooCommerce Review Reminder', 'yith-woocommerce-review-reminder')), 'title_second_column' => __('Get Support and Pro Features', 'yith-woocommerce-review-reminder'), 'description_second_column' => __('By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith-woocommerce-review-reminder'), 'button' => array('href' => YITH_WRR()->get_premium_landing_uri(), 'title' => 'Get Support and Pro Features')), 'id' => 'ywrr_general_videobox'), 'review_reminder_general_title' => array('name' => __('General Settings', 'yith-woocommerce-review-reminder'), 'type' => 'title', 'desc' => ''), 'review_reminder_general_enable_plugin' => array('name' => __('Enable YITH WooCommerce Review Reminder', 'yith-woocommerce-review-reminder'), 'type' => 'checkbox', 'desc' => '', 'id' => 'ywrr_enable_plugin', 'default' => 'yes'), 'review_reminder_general_end' => array('type' => 'sectionend'), 'review_reminder_mail_section_title' => array('name' => __('Mail Settings', 'yith-woocommerce-review-reminder'), 'type' => 'title', 'desc' => ''), 'review_reminder_mail_type' => array('name' => __('Email type', 'yith-woocommerce-review-reminder'), 'type' => 'select', 'desc' => __('Choose which format of email to send.', 'yith-woocommerce-review-reminder'), 'options' => array('html' => __('HTML', 'yith-woocommerce-review-reminder'), 'plain' => __('Plain text', 'yith-woocommerce-review-reminder')), 'default' => 'html', 'id' => 'ywrr_mail_type'), 'review_reminder_mail_subject' => array('name' => __('Email subject', 'yith-woocommerce-review-reminder'), 'type' => 'text', 'desc' => $placeholders_text . $ph_site_title . $ph_reference_link, 'id' => 'ywrr_mail_subject', 'default' => __('[{site_title}] Review recently purchased products', 'yith-woocommerce-review-reminder'), 'css' => 'width: 400px;', 'custom_attributes' => array('required' => 'required')), 'review_reminder_mail_body' => array('name' => __('Email content', 'yith-woocommerce-review-reminder'), 'type' => 'yith-wc-textarea', 'desc' => $placeholders_text . $ph_site_title . $ph_customer_name . $ph_customer_email . $ph_order_id . $ph_order_date . $ph_order_date_completed . $ph_order_list . $ph_days_ago . $ph_unsubscribe_link . $ph_reference_link, 'id' => 'ywrr_mail_body', 'default' => __('Hello {customer_name},
Thank you for purchasing items from the {site_title} shop!
We would love if you could help us and other customers by reviewing the products you recently purchased.
It only takes a minute and it would really help others by giving them an idea of your experience.
Click the link below for each product and review the product under the \'Reviews\' tab.

{order_list}

Much appreciated,

{site_title}.


{unsubscribe_link}', 'yith-woocommerce-review-reminder'), 'class' => 'ywrr-textarea', 'custom_attributes' => array('required' => 'required')), 'review_reminder_mail_unsubscribe_text' => array('name' => __('Review unsubscription text', 'yith-woocommerce-review-reminder'), 'type' => 'text', 'desc' => '', 'id' => 'ywrr_mail_unsubscribe_text', 'default' => __('Unsubscribe from review emails', 'yith-woocommerce-review-reminder'), 'css' => 'width: 400px;', 'custom_attributes' => array('required' => 'required')), 'review_reminder_mail_test' => array('name' => __('Test email', 'yith-woocommerce-review-reminder'), 'type' => 'ywrr-send', 'field_id' => 'ywrr_email_test'), 'review_reminder_mail_section_end' => array('type' => 'sectionend')));
コード例 #3
0
ファイル: init.php プロジェクト: VitaliyProdan/wp_shop
function ywrr_init()
{
    /* Load YWRR text domain */
    load_plugin_textdomain('yith-woocommerce-review-reminder', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    YITH_WRR();
}
コード例 #4
0
 /**
  * Apply inline styles to dynamic content.
  *
  * @since   1.1.8
  *
  * @param   string|null $content
  *
  * @return  string
  * @author  Alberto Ruggiero
  */
 public function style_inline($content)
 {
     // make sure we only inline CSS for html emails
     if (in_array($this->get_content_type(), array('text/html', 'multipart/alternative')) && class_exists('DOMDocument')) {
         ob_start();
         if (array_key_exists($this->template_type, YITH_WRR()->_email_templates)) {
             $path = YITH_WRR()->_email_templates[$this->template_type]['path'];
             $folder = YITH_WRR()->_email_templates[$this->template_type]['folder'];
             wc_get_template($folder . '/email-styles.php', array(), '', $path);
             $css = ob_get_clean();
         } else {
             wc_get_template('emails/email-styles.php');
             $css = apply_filters('woocommerce_email_styles', ob_get_clean());
         }
         // apply CSS styles inline for picky email clients
         try {
             $emogrifier = new Emogrifier($content, $css);
             $content = $emogrifier->emogrify();
         } catch (Exception $e) {
             $logger = new WC_Logger();
             $logger->add('emogrifier', $e->getMessage());
         }
     }
     return $content;
 }