Title: indigo74's Replies | WordPress.org

---

# indigo74

  [  ](https://wordpress.org/support/users/indigo74/)

 *   [Profile](https://wordpress.org/support/users/indigo74/)
 *   [Topics Started](https://wordpress.org/support/users/indigo74/topics/)
 *   [Replies Created](https://wordpress.org/support/users/indigo74/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/indigo74/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/indigo74/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/indigo74/engagements/)
 *   [Favorites](https://wordpress.org/support/users/indigo74/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Customize WordPress Emails and Alerts - Better Notifications for WP] Custom shortcode in transactionnal email not working](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/)
 *  Thread Starter [indigo74](https://wordpress.org/support/users/indigo74/)
 * (@indigo74)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/#post-9821090)
 * I just noticed you added this workaround in your documentation [https://betternotificationsforwp.com/documentation/adding-custom-shortcodes/](https://betternotificationsforwp.com/documentation/adding-custom-shortcodes/)
 * You’re welcome, by the way 😉
    -  This reply was modified 8 years, 4 months ago by [indigo74](https://wordpress.org/support/users/indigo74/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Customize WordPress Emails and Alerts - Better Notifications for WP] Custom shortcode in transactionnal email not working](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/)
 *  Thread Starter [indigo74](https://wordpress.org/support/users/indigo74/)
 * (@indigo74)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/#post-9764906)
 * Found a nice workaround 🙂
 * For your information, and for other users wanting to do the same, here is what
   I did:
 * Put this in your functions.php file:
 *     ```
       /** wp_mail filter
        *  Make sure shortcode are processed in mail body
        */
       add_filter('wp_mail', function($args) {
           // Perform shortcode replace in message body
           $args['message'] = do_shortcode($args['message']);
           return $args;
       }, 1, 1);
       ```
   
 * Works like a charm 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Customize WordPress Emails and Alerts - Better Notifications for WP] Custom shortcode in transactionnal email not working](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/)
 *  Thread Starter [indigo74](https://wordpress.org/support/users/indigo74/)
 * (@indigo74)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/#post-9763954)
 * Oh ok… I though it was something working… Damn 🙁
 * Isn’t it only a matter of performing a `do_shortcode()` before sending?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Customize WordPress Emails and Alerts - Better Notifications for WP] Custom shortcode in transactionnal email not working](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/)
 *  Thread Starter [indigo74](https://wordpress.org/support/users/indigo74/)
 * (@indigo74)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/#post-9763624)
 * I can successfully use custom notification, such as [my-custom-shortcode], with
   BNFW for notification like “New Post”.
 * However, for notification like “New User – Welcome mail”, it is not working.
 * I am _not_ talking about usual shortcode like [post_content] or [user_id] (as
   defined in [http://betternotificationsforwp.com/documentation/notifications/shortcodes/](http://betternotificationsforwp.com/documentation/notifications/shortcodes/)),
   which works well. I am only talking about custom shortcode that I created in 
   my functions.php file.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Customize WordPress Emails and Alerts - Better Notifications for WP] Custom shortcode in transactionnal email not working](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/)
 *  Thread Starter [indigo74](https://wordpress.org/support/users/indigo74/)
 * (@indigo74)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/#post-9760771)
 * Of course, I use it like [my_custom_shortcode]
 * Other shortcodes work fine, like [global_user_lastname] and so on…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Customize WordPress Emails and Alerts - Better Notifications for WP] Custom shortcode in transactionnal email not working](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/)
 *  Thread Starter [indigo74](https://wordpress.org/support/users/indigo74/)
 * (@indigo74)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/custom-shortcode-in-transactionnal-email-not-working/#post-9760766)
 * As I said, this is a custom shortcode that I defined in functions.php.
 * Example:
 *     ```
       function my_custom_shortcode_fn($atts, $content = null) {
           error_log("shortcode");
           ...
           return '';
       }
       add_shortcode('my_custom_shortcode', 'my_custom_shortcode_fn');
       ```
   
 * It works fine for notifications like New Custom Post. But not for “New User –
   for User”
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Customize WordPress Emails and Alerts - Better Notifications for WP] Notification on page/post deletion?](https://wordpress.org/support/topic/notification-on-page-post-deletion/)
 *  Thread Starter [indigo74](https://wordpress.org/support/users/indigo74/)
 * (@indigo74)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/notification-on-page-post-deletion/#post-9760452)
 * I just added a review: ***** 5 stars!
 * Hope to see this feature coming some days.
 * Bye!

Viewing 7 replies - 1 through 7 (of 7 total)