Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Last active August 29, 2015 14:16
Show Gist options
  • Save SeanChDavis/c4af1fec6d59bb139eaa to your computer and use it in GitHub Desktop.
Save SeanChDavis/c4af1fec6d59bb139eaa to your computer and use it in GitHub Desktop.
EDD {downloads} email tag
<?php // DO NOT COPY THIS LINE
/**
* 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 (no links)
*/
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 ) {
$download_list .= '<li>' . get_the_title( $item['id'] ) . '<br/>';
$download_list .= '</li>';
}
}
$download_list .= '</ul>';
return $download_list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment