Documentation

Email Messages

Description

Filters the list of email messages sent by Tournamatch. Tournamatch sends out numerous email messages. There are messages for tournament starting, ladder match results to confirm, match disputes, team membership, etc.

Use this filter if you want to remove and disable a message from sending. A complete list every email message is below:

Message Description
admin_test Sent when an admin uses the Test Email form.
admin_competition_petition Sent to admins when a user petitions to join a ladder or tournament with Requires Approval enabled.
admin_match_disputed Sent to admins when a user disputes a match result.
challenge_accepted Sent to a challenger when a direct or blind challenge is accepted.
challenge_declined Sent to a challenger when a challengee declines a direct challenge.
challenge_received Sent to a challengee when a challenger creates a direct challenge.
match_disputed Sent to the competitor that reported a match when the match result is disputed by the opponent.
match_reported Sent to the opponent of a match when a competitor reports a match result.
membership_invitation_accepted Sent to the Team Captain when a user accepts an invitation to join a team.
membership_invitation_declined Sent to the Team Captain when a user declines an invitation to join a team.
membership_request_accepted Sent to a user when a Team Captain accepts a request to join a team.
membership_request_declined Sent to a user when a Team Captain declines a request to join a team.
membership_invited Sent to a user when a Team Captain invites a player to join a team.
membership_requested Sent to the Team Captain when a user requests to join a team.
petition_accepted Sent to the competitor who petitioned to join an event when an admin approves the petition.
petition_declined Sent to the competitor who petitioned to join an event when an admin declines the petition.
tournament_eliminated Sent to a competitor which has been completely eliminated from a tournament.
tournament_matched Sent to a competitor when the next opponent is determined in a tournament. This is not sent for round 1 matches.
tournament_started Sent to all competitors in a tournament when the tournament is started.

Usage

function filter_email_messages( $messages ) {
    # ....
}
add_filter( 'trn_core_email_messages', 'filter_email_messages' );

Parameters

messages
(array)(required) Array of email messages enabled.

Examples

The following sample code removes the tournament-started message from being sent to competitors.

function filter_email_messages( $messages ) {

    if ( is_array( $messages ) ) {
        unset( $messages['tournament_started'] );
    }

    return $messages;
}
add_filter( 'trn_core_email_messages', 'filter_email_messages' );

Changelog

Version Description
3.17.0 Introduced