forked from jonom/silverstripe-postmark-mailer
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
MailgunMailer.php around line 220; fix check for valid email adresses
(may be multiple and/or formatted as "Sender Name" <[email protected]>
)
// We need _at least_ one valid $to addresses
$to_email_arr = explode(',', $to);
$to_email_formatted = array_shift($to_email_arr);
$to_email_parts = explode('<', $to_email_formatted);
$to_email_address = trim(str_replace('>', '', array_pop($to_email_parts)));
if ( ! filter_var($to_email_address, FILTER_VALIDATE_EMAIL)) {
user_error('MailgunMailer::sendMailgunEmail invalid $to [' . $to . ']', $err_type);
return false;
// $from = Email::config()->get('admin_email');
}
// We need a valid $from address
$from_email_parts = explode('<', $from);
$from_email_address = trim(str_replace('>', '', array_pop($from_email_parts)));
if ( ! filter_var($from_email_address, FILTER_VALIDATE_EMAIL)) {
// ... and throw error if still invalid
user_error('MailgunMailer::sendMailgunEmail invalid $from [' . $from . ']. Maybe set a default Email.admin_email in yaml config?', $err_type);
return false;
}
MailgunMailer.php around line 250; leave Reply-To
headers in peace
// if (array_key_exists('Reply-To', $customHeaders)) {
// $replyTo = $customHeaders['Reply-To'];
// unset($customHeaders['Reply-To']);
// }
Metadata
Metadata
Assignees
Labels
No labels