Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Add Transfer Message to Emails
- * @since 1.0
- * @version 1.0
- */
- function mycred_pro_add_transfer_message_to_emails( $body, $email, $addon ) {
- $data = $email['request']['data'];
- // Default text to show if no message was given
- $message = 'No message';
- // This is where the message should be stored
- if ( is_array( $data ) && ! empty( $data ) && array_key_exists( 'message', $data ) )
- $message = $data['message'];
- // Replace our custom template tag with the actual message
- return str_replace( '%transfer-message%', $message, $body );
- }
- add_filter( 'mycred_email_message_body', 'mycred_pro_add_transfer_message_to_emails', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement