WordPress shortcode in email data (Feature request, patch included)
-
Hey,
I’ve run into a situation where I would like to be able to use wordpress shortcode in the email template (subject and body). I’ve made a quick change in my copy of the plugin, but thought others might like this as well. I’ve included the patch below. I’m not sure if there’s a better place to do the shortcode, but this seemed logical to me.
Edit: I just realized this might not be the right place to submit this since it’s a “support” forum, but I’m not really sure where this would belong.
Index: includes/classes.php =================================================================== --- includes/classes.php (revision 684892) +++ includes/classes.php (working copy) @@ -546,6 +546,9 @@ if ( $additional_headers ) $headers .= $additional_headers . "\n"; + $subject = do_shortcode( $subject); + $body = do_shortcode( $body ); + if ( $send ) return @wp_mail( $recipient, $subject, $body, $headers, $attachments ); @@ -851,4 +854,4 @@ return implode( ' ', $classes ); } -?> \ No newline at end of file +?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘WordPress shortcode in email data (Feature request, patch included)’ is closed to new replies.