How to Filter Email Messages

How to Filter Email Messages

Tournamatch sends out dozens of email notifications for activities and events. Competitors receive an email notification when a match report needs to be confirmed, when a tournament starts, for team membership requests, and many more. In some cases, you may wish to limit the emails sent to users. This article demonstrates a short snippet of code to filter out email messages sent by Tournamatch.

Depending on your use case for Tournamatch, you may wish to prevent certain emails from hitting a users inbox. For example, suppose you want to run everything manually or you don’t want users to attempt to confirm matches. Or maybe you want to send out a different tournament announcement email when your event starts. By applying a filter to the hook trn_core_email_message, you may remove any message from the list of messages supported. Here’s a sample snippet below using the Code Snippets plugin we reviewed in our How to Extend a Plugin in WordPress with a Filter Hook blog:

Filter email messages to users.
Filter email messages to users.

Once this code is saved and activated, email messages for ‘tournament_started’ and ‘tournament_match_set’ will no longer go out to competitors. Check out our email messages filter documentation for a complete list of all email messages currently supported. Using this feature requires at least version 3.17 of Tournamatch.

Share this post

Leave a Reply

Your email address will not be published.