Alerts trigger a WP_Error when no email addresses are set
-
Hi!
We’ve noticed that the Sucuri plugin still tries to send email alerts even when there are no email addresses in the list of recipients. And, when sending a “Test Email” from the Alerts settings page, it will reload the page and say it was sent successfully, which of course cannot be true.
This is triggering a
WP_Error
when it happens (presumably because Sucuri is callingwp_mail
but not providing aTo:
address.)Below is a WP_Error object that we logged; this dev site happened to be using the Fluent SMTP plugin (Configured to send outbound mail through Mailgun), but the issue is the same regardless.
WP_Error Object
(
[errors] => Array
(
[wp_mail_failed] => Array
(
[0] => Mailgun API Error
)
)
[error_data] => Array
(
[wp_mail_failed] => Array
(
[to] => Array
(
[0] =>
)
[subject] => Sucuri Alert, dev.local, Test Email Alert, 127.0.0.1
[message] =>
Event: Test Email Alert
Website: https://dev.local
IP Address: 127.0.0.1
Reverse IP: dev.local
Date/Time: July 25, 2024 4:21 pm
User: andrew
Message: Test email alert sent at July 25, 2024 4:21 pm
[headers] => Array
(
)
[attachments] => Array
(
)
[phpmailer_exception_code] => 400
)
)
[additional_data:protected] => Array
(
)
)Thanks!
- You must be logged in to reply to this topic.