Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created January 24, 2014 22:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pippinsplugins/8607810 to your computer and use it in GitHub Desktop.
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+
<?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