Quantcast
Channel: WordPress.org Forums » [Contact Form 7] Support
Viewing all articles
Browse latest Browse all 49500

jrblast on "[Plugin: Contact Form 7] WordPress shortcode in email data (Feature request, patch included)"

$
0
0

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
+?>

http://wordpress.org/extend/plugins/contact-form-7/


Viewing all articles
Browse latest Browse all 49500

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>