当前位置: 首页>>代码示例>>PHP>>正文


PHP edd_get_payment_user_email函数代码示例

本文整理汇总了PHP中edd_get_payment_user_email函数的典型用法代码示例。如果您正苦于以下问题:PHP edd_get_payment_user_email函数的具体用法?PHP edd_get_payment_user_email怎么用?PHP edd_get_payment_user_email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了edd_get_payment_user_email函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ck_edd_user_download_button

function ck_edd_user_download_button($purchase_form, $args)
{
    global $edd_options;
    if (!is_user_logged_in()) {
        return $purchase_form;
    }
    $download_id = (string) $args['download_id'];
    $current_user_id = get_current_user_id();
    // If the user has purchased this item, itterate through their purchases to get the specific
    // purchase data and pull out the key and email associated with it. This is necessary for the
    // generation of the download link
    if (edd_has_user_purchased($current_user_id, $download_id, $variable_price_id = null)) {
        $user_purchases = edd_get_users_purchases($current_user_id, -1, false, 'complete');
        foreach ($user_purchases as $purchase) {
            $cart_items = edd_get_payment_meta_cart_details($purchase->ID);
            $item_ids = wp_list_pluck($cart_items, 'id');
            if (in_array($download_id, $item_ids)) {
                $email = edd_get_payment_user_email($purchase->ID);
                $payment_key = edd_get_payment_key($purchase->ID);
            }
        }
        $download_ids = array();
        if (edd_is_bundled_product($download_id)) {
            $download_ids = edd_get_bundled_products($download_id);
        } else {
            $download_ids[] = $download_id;
        }
        // Setup the style and colors associated with the settings
        $style = isset($edd_options['button_style']) ? $edd_options['button_style'] : 'button';
        $color = isset($edd_options['checkout_color']) ? $edd_options['checkout_color'] : 'blue';
        $new_purchase_form = '';
        foreach ($download_ids as $item) {
            // Attempt to get the file data associated with this download
            $download_data = edd_get_download_files($item, null);
            if ($download_data) {
                foreach ($download_data as $filekey => $file) {
                    // Generate the file URL and then make a link to it
                    $file_url = edd_get_download_file_url($payment_key, $email, $filekey, $item, null);
                    $new_purchase_form .= '<a href="' . $file_url . '" class="' . $style . ' ' . $color . ' edd-submit"><span class="edd-add-to-cart-label">Download ' . $file['name'] . '</span></a>&nbsp;';
                }
            }
            // As long as we ended up with links to show, use them.
            if (!empty($new_purchase_form)) {
                $purchase_form = '<h4>' . __('You already own this product. Download it now:', 'edd') . '</h4>' . $new_purchase_form;
            }
        }
    }
    return $purchase_form;
}
开发者ID:mintplugins,项目名称:library,代码行数:49,代码来源:replace-add-to-cart-with-download.php

示例2: wc_edd_email_purchase_receipt

/**
 * Helper Functions
 */
function wc_edd_email_purchase_receipt($payment_id, $download_id)
{
    $payment_data = edd_get_payment_meta($payment_id);
    $download = get_post($download_id);
    $license = edd_software_licensing()->get_license_by_purchase($payment_id, $download_id);
    $from_name = edd_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
    $from_name = apply_filters('edd_purchase_from_name', $from_name, $payment_id, $payment_data);
    $from_email = edd_get_option('from_email', get_bloginfo('admin_email'));
    $from_email = apply_filters('edd_purchase_from_address', $from_email, $payment_id, $payment_data);
    $to_email = edd_get_payment_user_email($payment_id);
    $subject = edd_get_option('purchase_subject', __('New License Key', 'edd'));
    $subject = apply_filters('edd_purchase_subject', wp_strip_all_tags($subject), $payment_id);
    $subject = edd_do_email_tags($subject, $payment_id);
    $message = "Dear " . edd_email_tag_first_name($payment_id) . ",\n\n";
    $message .= "As you have updated " . $download->post_title . ", please use following new license key to continue getting future updates: \n\n";
    $message .= "License Key : " . edd_software_licensing()->get_license_key($license->ID) . "\n\n";
    $message .= "Sorry for inconvenience.";
    $emails = EDD()->emails;
    $emails->__set('from_name', $from_name);
    $emails->__set('from_email', $from_email);
    $emails->__set('heading', __('Purchase Receipt', 'edd'));
    $headers = apply_filters('edd_receipt_headers', $emails->get_headers(), $payment_id, $payment_data);
    $emails->__set('headers', $headers);
    $emails->send($to_email, $subject, $message, array());
    if ($admin_notice && !edd_admin_notices_disabled($payment_id)) {
        do_action('edd_admin_sale_notice', $payment_id, $payment_data);
    }
}
开发者ID:kishoresahoo,项目名称:woocommerce-to-easydigitaldownloads,代码行数:31,代码来源:software.php

示例3: trigger

 /**
  * Trigger the tickets email
  *
  * @param int $payment_id
  *
  * @return string
  */
 public function trigger($payment_id = 0)
 {
     global $edd_options;
     $payment_data = edd_get_payment_meta($payment_id);
     $user_id = edd_get_payment_user_id($payment_id);
     $user_info = maybe_unserialize($payment_data['user_info']);
     $email = edd_get_payment_user_email($payment_id);
     if (isset($user_id) && $user_id > 0) {
         $user_data = get_userdata($user_id);
         $name = $user_data->display_name;
     } elseif (isset($user_info['first_name']) && isset($user_info['last_name'])) {
         $name = $user_info['first_name'] . ' ' . $user_info['last_name'];
     } else {
         $name = $email;
     }
     $message = $this->get_content_html($payment_id);
     $from_name = isset($edd_options['from_name']) ? $edd_options['from_name'] : get_bloginfo('name');
     $from_email = isset($edd_options['from_email']) ? $edd_options['from_email'] : get_option('admin_email');
     $subject = !empty($edd_options['ticket_subject']) ? wp_strip_all_tags($edd_options['ticket_subject'], true) : $this->default_subject;
     $subject = apply_filters('edd_ticket_receipt_subject', $subject, $payment_id);
     $subject = edd_email_template_tags($subject, $payment_data, $payment_id);
     $headers = 'From: ' . stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8')) . " <{$from_email}>\r\n";
     $headers .= 'Reply-To: ' . $from_email . "\r\n";
     $headers .= "Content-Type: text/html; charset=utf-8\r\n";
     $headers = apply_filters('edd_ticket_receipt_headers', $headers, $payment_id, $payment_data);
     // Allow add-ons to add file attachments
     $attachments = apply_filters('edd_ticket_receipt_attachments', array(), $payment_id, $payment_data);
     if (apply_filters('edd_email_ticket_receipt', true)) {
         wp_mail($email, $subject, $message, $headers, $attachments);
     }
 }
开发者ID:TakenCdosG,项目名称:chefs,代码行数:38,代码来源:Email.php

示例4: column_default

 /**
  * This function renders most of the columns in the list table.
  *
  * @access public
  * @since 1.4
  *
  * @param array $item Contains all the data of the log item
  * @param string $column_name The name of the column
  *
  * @return string Column Name
  */
 public function column_default($item, $column_name)
 {
     $return = '';
     switch ($column_name) {
         case 'download':
             $return = '<a href="' . add_query_arg('download', $item[$column_name]) . '" >' . get_the_title($item[$column_name]) . '</a>';
             break;
         case 'user_id':
             $user = !empty($item['user_id']) ? $item['user_id'] : edd_get_payment_user_email($item['payment_id']);
             $return = '<a href="' . admin_url('edit.php?post_type=download&page=edd-payment-history&user=' . urlencode($user)) . '">' . $item['user_name'] . '</a>';
             break;
         case 'item_price':
             $return = edd_currency_filter(edd_format_amount($item['item_price']));
             break;
         case 'amount':
             $return = edd_currency_filter(edd_format_amount($item['amount'] / $item['quantity']));
             break;
         case 'payment_id':
             $return = '<a href="' . admin_url('edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=' . $item['payment_id']) . '">' . edd_get_payment_number($item['payment_id']) . '</a>';
             break;
         default:
             $return = $item[$column_name];
             break;
     }
     return $return;
 }
开发者ID:jplhomer,项目名称:Easy-Digital-Downloads,代码行数:37,代码来源:class-sales-logs-list-table.php

示例5: edd_email_purchase_receipt

/**
 * Email the download link(s) and payment confirmation to the buyer in a
 * customizable Purchase Receipt
 *
 * @since 1.0
 * @param int $payment_id Payment ID
 * @param bool $admin_notice Whether to send the admin email notification or not (default: true)
 * @return void
 */
function edd_email_purchase_receipt($payment_id, $admin_notice = true)
{
    global $edd_options;
    $payment_data = edd_get_payment_meta($payment_id);
    $user_info = maybe_unserialize($payment_data['user_info']);
    $email = edd_get_payment_user_email($payment_id);
    if (isset($user_info['id']) && $user_info['id'] > 0) {
        $user_data = get_userdata($user_info['id']);
        $name = $user_data->display_name;
    } elseif (isset($user_info['first_name']) && isset($user_info['last_name'])) {
        $name = $user_info['first_name'] . ' ' . $user_info['last_name'];
    } else {
        $name = $email;
    }
    $message = edd_get_email_body_header();
    $message .= edd_get_email_body_content($payment_id, $payment_data);
    $message .= edd_get_email_body_footer();
    $from_name = isset($edd_options['from_name']) ? $edd_options['from_name'] : get_bloginfo('name');
    $from_email = isset($edd_options['from_email']) ? $edd_options['from_email'] : get_option('admin_email');
    $subject = apply_filters('edd_purchase_subject', isset($edd_options['purchase_subject']) ? trim($edd_options['purchase_subject']) : __('Purchase Receipt', 'edd'), $payment_id);
    $subject = edd_email_template_tags($subject, $payment_data, $payment_id);
    $headers = "From: " . stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8')) . " <{$from_email}>\r\n";
    $headers .= "Reply-To: " . $from_email . "\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=utf-8\r\n";
    $headers = apply_filters('edd_receipt_headers', $headers, $payment_id, $payment_data);
    // Allow add-ons to add file attachments
    $attachments = apply_filters('edd_receipt_attachments', array(), $payment_id, $payment_data);
    wp_mail($email, $subject, $message, $headers, $attachments);
    if ($admin_notice && !edd_admin_notices_disabled()) {
        do_action('edd_admin_sale_notice', $payment_id, $payment_data);
    }
}
开发者ID:bangtienmanh,项目名称:Easy-Digital-Downloads,代码行数:42,代码来源:functions.php

示例6: add_pending_referral

 /**
  * Records a pending referral when a pending payment is created
  *
  * @access  public
  * @since   1.0
  */
 public function add_pending_referral($payment_id = 0, $payment_data = array())
 {
     if ($this->was_referred()) {
         $customer_email = edd_get_payment_user_email($payment_id);
         if ($this->is_affiliate_email($customer_email)) {
             return;
             // Customers cannot refer themselves
         }
         if (affiliate_wp()->settings->get('edd_disable_on_renewals')) {
             $was_renewal = get_post_meta($payment_id, '_edd_sl_is_renewal', true);
             if ($was_renewal) {
                 return;
             }
         }
         // get referral total
         $referral_total = $this->get_referral_total($payment_id, $this->affiliate_id);
         // Referral description
         $desc = $this->get_referral_description($payment_id);
         if (empty($desc)) {
             return;
         }
         // insert a pending referral
         $referral_id = $this->insert_pending_referral($referral_total, $payment_id, $desc, $this->get_products($payment_id));
     }
 }
开发者ID:jwondrusch,项目名称:AffiliateWP,代码行数:31,代码来源:class-edd.php

示例7: edd_email_purchase_receipt

/**
 * Email the download link(s) and payment confirmation to the buyer in a
 * customizable Purchase Receipt
 *
 * @since 1.0
 * @param int $payment_id Payment ID
 * @param bool $admin_notice Whether to send the admin email notification or not (default: true)
 * @return void
 */
function edd_email_purchase_receipt($payment_id, $admin_notice = true)
{
    $payment_data = edd_get_payment_meta($payment_id);
    $from_name = edd_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
    $from_name = apply_filters('edd_purchase_from_name', $from_name, $payment_id, $payment_data);
    $from_email = edd_get_option('from_email', get_bloginfo('admin_email'));
    $from_email = apply_filters('edd_purchase_from_address', $from_email, $payment_id, $payment_data);
    $to_email = edd_get_payment_user_email($payment_id);
    $subject = edd_get_option('purchase_subject', __('Purchase Receipt', 'edd'));
    $subject = apply_filters('edd_purchase_subject', wp_strip_all_tags($subject), $payment_id);
    $subject = edd_do_email_tags($subject, $payment_id);
    $heading = edd_get_option('purchase_heading', __('Purchase Receipt', 'edd'));
    $heading = apply_filters('edd_purchase_heading', $heading, $payment_id, $payment_data);
    $attachments = apply_filters('edd_receipt_attachments', array(), $payment_id, $payment_data);
    $message = edd_do_email_tags(edd_get_email_body_content($payment_id, $payment_data), $payment_id);
    $emails = EDD()->emails;
    $emails->__set('from_name', $from_name);
    $emails->__set('from_email', $from_email);
    $emails->__set('heading', $heading);
    $headers = apply_filters('edd_receipt_headers', $emails->get_headers(), $payment_id, $payment_data);
    $emails->__set('headers', $headers);
    $emails->send($to_email, $subject, $message, $attachments);
    if ($admin_notice && !edd_admin_notices_disabled($payment_id)) {
        do_action('edd_admin_sale_notice', $payment_id, $payment_data);
    }
}
开发者ID:nitun,项目名称:Easy-Digital-Downloads,代码行数:35,代码来源:functions.php

示例8: set_from_address

 public function set_from_address($emails_class)
 {
     global $edd_payment_id;
     if (empty($edd_payment_id)) {
         return;
     }
     $emails_class->from_address = edd_get_payment_user_email($edd_payment_id);
 }
开发者ID:mintplugins,项目名称:library,代码行数:8,代码来源:send-sale-alerts-from-customer-email.php

示例9: ao_edd_set_customer_role

function ao_edd_set_customer_role($payment_id)
{
    $email = edd_get_payment_user_email($payment_id);
    $downloads = edd_get_payment_meta_downloads($payment_id);
    $user_id = edd_get_payment_user_id($payment_id);
    if ($user_id) {
        $user = new WP_User($user_id);
        // Add role
        $user->add_role('buyer');
    }
}
开发者ID:mintplugins,项目名称:library,代码行数:11,代码来源:change_buyer_role.php

示例10: track_purchase

 /**
  * Create identity and track purchase
  * @param  int $payment_id
  * @return null
  */
 public static function track_purchase($payment_id)
 {
     $user_id = edd_get_payment_user_id($payment_id);
     $uid = EDD_Segment_Identity::get_uid_from_user_id($user_id);
     // Send identity
     $traits = array('name' => edd_email_tag_fullname($payment_id), 'email' => edd_get_payment_user_email($payment_id));
     do_action('edd_segment_identify', $uid, $traits);
     // Track the purchase event
     $props = array('trans_id' => edd_get_payment_transaction_id($payment_id), 'total' => edd_get_payment_amount($payment_id), 'time' => strtotime(edd_get_payment_completed_date($payment_id)));
     do_action('edd_segment_track', $uid, 'Checkout', $props);
 }
开发者ID:SproutApps,项目名称:segment-io,代码行数:16,代码来源:EDD_Hooks.php

示例11: subscribe_from_edd

 /**
  * @param int $payment_id The ID of the payment
  *
  * @return bool|string
  */
 public function subscribe_from_edd($payment_id)
 {
     if (!$this->triggered($payment_id)) {
         return false;
     }
     $email = (string) edd_get_payment_user_email($payment_id);
     $merge_vars = array();
     // add first and last name to merge vars, if given
     $user_info = (array) edd_get_payment_meta_user_info($payment_id);
     if (isset($user_info['first_name']) && isset($user_info['last_name'])) {
         $merge_vars['NAME'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
     }
     if (isset($user_info['first_name'])) {
         $merge_vars['FNAME'] = $user_info['first_name'];
     }
     if (isset($user_info['last_name'])) {
         $merge_vars['LNAME'] = $user_info['last_name'];
     }
     return $this->subscribe($email, $merge_vars, $payment_id);
 }
开发者ID:aaronfrey,项目名称:PepperLillie-TAT,代码行数:25,代码来源:class-easy-digital-downloads.php

示例12: subscribe_from_edd

 /**
  * @param int $payment_id The ID of the payment
  *
  * @return bool|string
  */
 public function subscribe_from_edd($payment_id)
 {
     if (!$this->triggered($payment_id)) {
         return false;
     }
     $email = (string) edd_get_payment_user_email($payment_id);
     $data = array('EMAIL' => $email);
     // add first and last name to merge vars, if given
     $user_info = (array) edd_get_payment_meta_user_info($payment_id);
     if (!empty($user_info['first_name']) && !empty($user_info['last_name'])) {
         $data['NAME'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
     }
     if (!empty($user_info['first_name'])) {
         $data['FNAME'] = $user_info['first_name'];
     }
     if (!empty($user_info['last_name'])) {
         $data['LNAME'] = $user_info['last_name'];
     }
     return $this->subscribe($data, $payment_id);
 }
开发者ID:dannyvankooten,项目名称:mailchimp-for-wordpress,代码行数:25,代码来源:class-easy-digital-downloads.php

示例13: edd_ti_send_tracking

function edd_ti_send_tracking($post)
{
    $nonce = !empty($post['nonce']) ? $post['nonce'] : false;
    if (!wp_verify_nonce($nonce, 'edd-ti-send-tracking')) {
        wp_die();
    }
    $tracking_id = edd_ti_get_payment_tracking_id($post['payment_id']);
    if (empty($tracking_id)) {
        return;
    }
    $from_name = edd_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
    $from_email = edd_get_option('from_email', get_bloginfo('admin_email'));
    $to_email = edd_get_payment_user_email($post['payment_id']);
    $subject = 'Your order has shipped';
    $heading = 'Your order has shipped!';
    $message = '<p>Your recent order ' . $post['payment_id'] . ' has been shipped.</p>';
    $message .= '<p>Tracking ID: <a href="' . edd_ti_get_payment_tracking_link($post['payment_id']) . '">' . $tracking_id . '</a></p>';
    $message .= '<p>Thank you!</p>';
    $message .= '<p>The ' . $from_name . ' team</p>';
    $headers = "From: " . stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8')) . " <{$from_email}>\r\n";
    $headers .= "Reply-To: " . $from_email . "\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=utf-8\r\n";
    $attachments = array();
    $emails = EDD()->emails;
    $emails->__set('from_name', $from_name);
    $emails->__set('from_email', $from_email);
    $emails->__set('heading', $heading);
    $emails->__set('headers', $headers);
    $result = $emails->send($to_email, $subject, $message, $attachments);
    $response = array('success' => $result);
    $response['message'] = $result ? __('Email sent.', 'edd-tracking-info') : __('Error sending email. Try again later.', 'edd-tracking-info');
    if ($result) {
        edd_update_payment_meta($post['payment_id'], 'edd_tracking_info_sent', true);
        edd_insert_payment_note($post['payment_id'], sprintf(__('Tracking information sent to %s.', 'edd-tracking-info'), $to_email));
    }
    echo json_encode($response);
    die;
}
开发者ID:cklosowski,项目名称:edd-tracking-info,代码行数:39,代码来源:metabox.php

示例14: subscribe_from_edd_purchase

 /**
  * @param int $payment_id The ID of the payment
  *
  * @return bool|string
  */
 public function subscribe_from_edd_purchase($payment_id)
 {
     $meta = get_post_meta($payment_id, '_yikes_easy_mc_optin', true);
     if ($meta == '0') {
         return false;
     }
     $email = (string) edd_get_payment_user_email($payment_id);
     $merge_vars = array();
     // add first and last name to merge vars, if given
     $user_info = (array) edd_get_payment_meta_user_info($payment_id);
     if (isset($user_info['first_name']) && isset($user_info['last_name'])) {
         $merge_vars['NAME'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
     }
     if (isset($user_info['first_name'])) {
         $merge_vars['FNAME'] = $user_info['first_name'];
     }
     if (isset($user_info['last_name'])) {
         $merge_vars['LNAME'] = $user_info['last_name'];
     }
     // subscribe the user
     $this->subscribe_user_integration(sanitize_email($email), $this->type, $merge_vars);
 }
开发者ID:misfist,项目名称:missdrepants-network,代码行数:27,代码来源:class.easy_digital_downloads_checkout_form-checkbox.php

示例15: edd_wallet_email_tag_user_email

/**
 * Email template tag: user_email
 * The buyer's email address
 *
 * @since       1.0.0
 * @param       int $payment_id
 * @return      string user_email
 */
function edd_wallet_email_tag_user_email($payment_id)
{
    if (get_post_type($payment_id) == 'edd_payment') {
        return edd_get_payment_user_email($payment_id);
    } else {
        $item = edd_wallet()->db->get_customer_wallet_item($payment_id);
        $user_data = get_userdata($item->user_id);
        return $user_data->user_email;
    }
}
开发者ID:easydigitaldownloads,项目名称:edd-wallet,代码行数:18,代码来源:class.edd-email-tags.php


注:本文中的edd_get_payment_user_email函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。