• Resolved typeless

    (@jbalyo)


    With this plugin, is there any way to customize error messages? There is one in particular that occurs when a Lost Password email fails to go out. This is sent from /includes/compat.php:

    “The email could not be sent. Your site may not be correctly configured to send emails.”

    I would like to customize that messaging to be more helpful to the end user, but I do not see any hooks or filters for it – only one for manipulating the email itself. Is this possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    Which TML version are you using?

    Thread Starter typeless

    (@jbalyo)

    Theme My Login v 7.1.10

    It would be nice if the option to edit error messaging was part of the plugin, but I did end up finding a workaround using a filter:

    function my_custom_error_msg($error) {
    if ( str_contains($error, "The email could not be sent. Your site may not be correctly configured to send emails.") ) {
    $error = "<strong>Error:</strong> Your email address is not on file with us. Please contact an administrator for assistance.";
    }
    return $error;
    }
    add_filter('login_errors', 'my_custom_error_msg');
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to customize error message’ is closed to new replies.