fix(email): set sender before PHPMailer init
This commit is contained in:
@@ -47,7 +47,14 @@ test('email templates and SMTP use one aksrt_settings schema', () => {
|
||||
})
|
||||
|
||||
test('SMTP authentication and failures use the canonical mail service', () => {
|
||||
assert.match(coreHooks, /add_filter\('wp_mail_from',/)
|
||||
assert.match(coreHooks, /add_filter\('wp_mail_from_name',/)
|
||||
assert.match(coreHooks, /if \(empty\(\$mail\['enabled'\]\)\) return \$from/)
|
||||
assert.match(coreHooks, /if \(empty\(\$mail\['enabled'\]\)\) return \$from_name/)
|
||||
assert.match(coreHooks, /\$mail\['from_address'\]/)
|
||||
assert.match(coreHooks, /\$mail\['from_name'\]/)
|
||||
assert.match(coreHooks, /\$phpmailer->SMTPAuth\s*=\s*!empty\(\$mail\['auth'\]\)\s*&&\s*!empty\(\$mail\['username'\]\)/)
|
||||
assert.doesNotMatch(coreHooks, /\$phpmailer->setFrom\(/)
|
||||
assert.match(mail, /add_action\('wp_mail_failed',\s*\$capture_failure\)/)
|
||||
assert.match(mail, /remove_action\('wp_mail_failed',\s*\$capture_failure\)/)
|
||||
assert.match(mail, /error_log\('\[AKSRT\] SMTP 测试失败:'/)
|
||||
|
||||
Reference in New Issue
Block a user