/** * Add default EDD email template tags * * @since 1.9 */ function edd_setup_email_tags() { // Setup default tags array $email_tags = array(array('tag' => 'download_list', 'description' => __('A list of download links for each download purchased', 'easy-digital-downloads'), 'function' => 'text/html' == EDD()->emails->get_content_type() ? 'edd_email_tag_download_list' : 'edd_email_tag_download_list_plain'), array('tag' => 'file_urls', 'description' => __('A plain-text list of download URLs for each download purchased', 'easy-digital-downloads'), 'function' => 'edd_email_tag_file_urls'), array('tag' => 'name', 'description' => __("The buyer's first name", 'easy-digital-downloads'), 'function' => 'edd_email_tag_first_name'), array('tag' => 'fullname', 'description' => __("The buyer's full name, first and last", 'easy-digital-downloads'), 'function' => 'edd_email_tag_fullname'), array('tag' => 'username', 'description' => __("The buyer's user name on the site, if they registered an account", 'easy-digital-downloads'), 'function' => 'edd_email_tag_username'), array('tag' => 'user_email', 'description' => __("The buyer's email address", 'easy-digital-downloads'), 'function' => 'edd_email_tag_user_email'), array('tag' => 'billing_address', 'description' => __('The buyer\'s billing address', 'easy-digital-downloads'), 'function' => 'edd_email_tag_billing_address'), array('tag' => 'date', 'description' => __('The date of the purchase', 'easy-digital-downloads'), 'function' => 'edd_email_tag_date'), array('tag' => 'subtotal', 'description' => __('The price of the purchase before taxes', 'easy-digital-downloads'), 'function' => 'edd_email_tag_subtotal'), array('tag' => 'tax', 'description' => __('The taxed amount of the purchase', 'easy-digital-downloads'), 'function' => 'edd_email_tag_tax'), array('tag' => 'price', 'description' => __('The total price of the purchase', 'easy-digital-downloads'), 'function' => 'edd_email_tag_price'), array('tag' => 'payment_id', 'description' => __('The unique ID number for this purchase', 'easy-digital-downloads'), 'function' => 'edd_email_tag_payment_id'), array('tag' => 'receipt_id', 'description' => __('The unique ID number for this purchase receipt', 'easy-digital-downloads'), 'function' => 'edd_email_tag_receipt_id'), array('tag' => 'payment_method', 'description' => __('The method of payment used for this purchase', 'easy-digital-downloads'), 'function' => 'edd_email_tag_payment_method'), array('tag' => 'sitename', 'description' => __('Your site name', 'easy-digital-downloads'), 'function' => 'edd_email_tag_sitename'), array('tag' => 'receipt_link', 'description' => __('Adds a link so users can view their receipt directly on your website if they are unable to view it in the browser correctly.', 'easy-digital-downloads'), 'function' => 'edd_email_tag_receipt_link'), array('tag' => 'discount_codes', 'description' => __('Adds a list of any discount codes applied to this purchase', 'easy-digital-downloads'), 'function' => 'edd_email_tag_discount_codes'), array('tag' => 'ip_address', 'description' => __('The buyer\'s IP Address', 'easy-digital-downloads'), 'function' => 'edd_email_tag_ip_address')); // Apply edd_email_tags filter $email_tags = apply_filters('edd_email_tags', $email_tags); // Add email tags foreach ($email_tags as $email_tag) { edd_add_email_tag($email_tag['tag'], $email_tag['description'], $email_tag['function']); } }
/** * Add license tag to email templates * Source: http://docs.easydigitaldownloads.com/article/497-edd-add-email-tag * * @since 1.0.0 * @return void */ function edd_slm_email_add_license_tag($payment_id) { edd_add_email_tag('slm_license_keys', 'Displays the generated license keys.', 'edd_slm_email_replace_license_tag'); }
public function add_email_tag() { edd_add_email_tag('license_keys', __('Show all purchased licenses', 'edd_sl'), array($this, 'licenses_tag')); }
function sumobi_edd_view_order_details($payment_meta, $user_info) { $phone = isset($payment_meta['phone']) ? $payment_meta['phone'] : 'none'; ?> <div class="column-container"> <div class="column"> <strong><?php echo 'Phone: '; ?> </strong> <?php echo $phone; ?> </div> </div> <?php } add_action('edd_payment_personal_details_list', 'sumobi_edd_view_order_details', 10, 2); /** * Add a {phone} tag for use in either the purchase receipt email or admin notification emails */ edd_add_email_tag('phone', 'Customer\'s phone number', 'sumobi_edd_email_tag_phone'); /** * The {phone} email tag */ function sumobi_edd_email_tag_phone($payment_id) { $payment_data = edd_get_payment_meta($payment_id); return $payment_data['phone']; }
/** * Register custom email tags. * * @since 1.5.0 */ public function register_email_tags() { edd_add_email_tag('browsing_history', __('Display the customer\'s browsing history prior to this transaction.', 'edduh'), array($this, 'email_tag_browsing_history')); edd_add_email_tag('purchase_history', __('Display the customer\'s purchase history and total lifetime value.', 'edduh'), array($this, 'email_tag_purchase_history')); }
/** * Register custom email tags {updated_products}, {updated_products_links}, * and {unsubscribe} for use in product update emails * * @access public * @param mixed $payment_id * @return void */ function edd_pup_email_tags($payment_id) { edd_add_email_tag('updated_products', __('Display a plain list of updated products', 'edd-pup'), 'none' == edd_pup_template() ? 'edd_pup_products_tag_plain' : 'edd_pup_products_tag'); edd_add_email_tag('updated_products_links', __('Display a list of updated products with links', 'edd-pup'), 'none' == edd_pup_template() ? 'edd_pup_products_links_tag_plain' : 'edd_pup_products_links_tag'); edd_add_email_tag('unsubscribe_link', __('Outputs an unsubscribe link users can click to opt-out of future product update emails', 'edd-pup'), 'none' == edd_pup_template() ? 'edd_pup_unsub_tag_plain' : 'edd_pup_unsub_tag'); }
/** * Registers our email tags * * @since 1.5.4 * @return void */ function edd_cr_register_email_tags() { edd_add_email_tag('page_list', __('Shows a list of restricted pages the customer has access to', 'edd-cr'), 'edd_cr_add_template_tags'); }
public function add_sample_tag() { edd_add_email_tag('replace_with_your_tag', 'Put your tag description here', array($this, 'render_tag_content')); }
<?php /* * Plugin Name: Easy Digital Downloads - Downloads Email Tag * Description: Adds a {downloads} email tag for use in email templates that outputs a simple list of linked downloads without file names * Author: Andrew Munro, Sumobi * Author URI: http://sumobi.com/ * Version: 1.0 */ /** * Add a {downloads} tag for use in either the purchase receipt email or admin notification emails */ edd_add_email_tag('downloads', __('A linked list of downloads purchased', 'edd'), 'sumobi_edd_email_tag_downloads'); /** * The {downloads} email tag */ function sumobi_edd_email_tag_downloads($payment_id) { $cart_items = edd_get_payment_meta_cart_details($payment_id); $download_list = '<ul>'; if ($cart_items) { foreach ($cart_items as $item) { $title = sprintf('<a href="%s">%s</a>', get_permalink($item['id']), get_the_title($item['id'])); $download_list .= '<li>' . $title . '<br/>'; $download_list .= '</li>'; } } $download_list .= '</ul>'; return $download_list; }