FEATURE: Log the SMTP response in EmailLog (#17056)

When sending emails with delivery_method_options -> return_response
set to true, the SMTP sending code inside Mail will return the SMTP
response when calling deliver! for mail within the app. This commit
ensures that Email::Sender captures this response if it is returned
and stores it against the EmailLog created for the sent email.

A follow up PR will make this visible within the admin email UI.
This commit is contained in:
Martin Brennan
2022-06-15 10:28:30 +10:00
committed by GitHub
parent 63df2b4550
commit 4d3c1ceb44
6 changed files with 61 additions and 32 deletions

View File

@ -145,6 +145,7 @@ module Email
}
args[:delivery_method_options] = @opts[:delivery_method_options] if @opts[:delivery_method_options]
args[:delivery_method_options] = (args[:delivery_method_options] || {}).merge(return_response: true)
args
end