Last active
August 29, 2015 14:16
-
-
Save SeanChDavis/c4af1fec6d59bb139eaa to your computer and use it in GitHub Desktop.
EDD {downloads} email tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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