Created
January 24, 2014 22:12
-
-
Save pippinsplugins/8607810 to your computer and use it in GitHub Desktop.
An example of how to create a custom email tag in EDD 1.9+
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 | |
class EDD_Sample_Email_Tag { | |
function __construct() { | |
add_action( 'edd_add_email_tags', array( $this, 'add_sample_tag' ), 100 ); | |
} | |
public function add_sample_tag() { | |
edd_add_email_tag( 'replace_with_your_tag', 'Put your tag description here', array( $this, 'render_tag_content' ) ); | |
} | |
public function render_tag_content( $payment_id = 0 ) { | |
$output = ''; | |
$cart_items = edd_get_payment_meta_cart_details( $payment_id, true ); | |
foreach( $cart_items as $item ) { | |
// do something to $output for each cart item | |
} | |
return $output; | |
} | |
} | |
new EDD_Sample_Email_Tag; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment