Skip to content

Instantly share code, notes, and snippets.

@rickalday
Created January 8, 2026 21:52
Show Gist options
  • Select an option

  • Save rickalday/8de9ee973b74b1f3e095d8f8650f2314 to your computer and use it in GitHub Desktop.

Select an option

Save rickalday/8de9ee973b74b1f3e095d8f8650f2314 to your computer and use it in GitHub Desktop.
Creates a {donation_id} for GiveWP Emails
<?php
function donation_id_tag( $email_tags ) {
$new_email_tag = array(
'tag' => 'donation_id',
'description' => esc_html__( 'This tag outputs the donation ID', 'give' ),
'function' => 'get_donation_id',
'context' => 'general', // Context can be general, donor, form or donation
);
array_push( $email_tags, $new_email_tag );
return $email_tags;
}
add_filter( 'give_email_tags', 'donation_id_tag' );
function get_donation_id( $tag_args ) {
$output = '';
$donation_id = $tag_args['payment_id'];
$output = $donation_id;
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment