Created
January 8, 2026 21:52
-
-
Save rickalday/8de9ee973b74b1f3e095d8f8650f2314 to your computer and use it in GitHub Desktop.
Creates a {donation_id} for GiveWP Emails
This file contains hidden or 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 | |
| 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