Title: Shortcode functionality
Last modified: August 31, 2016

---

# Shortcode functionality

 *  [Will Beeler](https://wordpress.org/support/users/webroasters/)
 * (@webroasters)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/shortcode-functionality/)
 * Hello!
 * I just wanted to say first, thank you for the plugin, nice job! I really like
   it, and I’m using it both personally and professionally. I was writing today 
   to see if you’d be interested in adding an update to it.
 * Is it possible to allow for shortcode execution within a template? So far, as
   I can see, no, but I don’t think it should be that difficult to include it, should
   it? For example, the following code allows for shortcode execution through a 
   filter for the widget area:
 * `add_filter('widget_text', 'do_shortcode');`
 * If you’re wondering the importance of including this feature, here’s my use case.
   You have a site wide email that goes out and at the bottom of the email it includes
   5 recent news articles from a shortcode that has to grab the data first and then
   output the html code.
 * I appreciate your time and effort,
 * William Beeler
 * [https://wordpress.org/plugins/ez-emails/](https://wordpress.org/plugins/ez-emails/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Will Beeler](https://wordpress.org/support/users/webroasters/)
 * (@webroasters)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/shortcode-functionality/#post-7276503)
 * I believe this is the answer to my own question (If you want to include it in
   your plugin):
 *     ```
       add_filter( 'wp_mail', 'my_wp_mail_filter' );
       function my_wp_mail_filter( $args ) {
   
       	$new_wp_mail = array(
       		'to'          => $args['to'],
       		'subject'     => $args['subject'],
       		'message'     => do_shortcode($args['message']),
       		'headers'     => $args['headers'],
       		'attachments' => $args['attachments'],
       	);
   
       	return $new_wp_mail;
       }
       ```
   
 * Notice the “do_shortcode(…” part. That’s what would fix the issue I’m having.
   This has been tested on my end, but not with your plugin.
 * Thanks!

Viewing 1 replies (of 1 total)

The topic ‘Shortcode functionality’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ez-emails_98b9d1.svg)
 * [EZ Emails](https://wordpress.org/plugins/ez-emails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ez-emails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ez-emails/)
 * [Active Topics](https://wordpress.org/support/plugin/ez-emails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ez-emails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ez-emails/reviews/)

## Tags

 * [email](https://wordpress.org/support/topic-tag/email/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 1 reply
 * 1 participant
 * Last reply from: [Will Beeler](https://wordpress.org/support/users/webroasters/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/shortcode-functionality/#post-7276503)
 * Status: not resolved