ankane / ahoy_email

First-party email analytics for Rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Catch (SMTP) errors when sending e-mails

Laykou opened this issue · comments

Hi,

while using this gem in production, I see opportunity for this gem to track also "failed" e-mails. I saw previous version captured e-mails before they were sent. Now they are being captured only when they pass through the gateway. However sometime there can be an issue e.g. with SMTP network connection or authentications...

In that case it makes sense to track the e-mail, so that we do not lose the content and mark it as "failed" with the error message. This would help us a lot to identify when e-mails are not being sent, what is the issue and resend the e-mails once the error is fixed.

Is something like this possible with this gem? Is there some configuration that we could already use or is this a new feature?

Thank you!

Hey @Laykou, that's an interesting idea. This isn't currently possibly with Ahoy Email. I feel like it's a bit out of scope for the project, but you can probably follow a similar pattern to catch errors with sending.

++ @Mattooo

@ankane Do you have any idea how to ideally:

  • use interceptor to track email before sending (old ahoy_email behavior)
  • use observers to confirm the emails has been sent successfully or to track any error received when (raise_delivery_errors = true)

What do you think? We cannot be the only one needing to track emails and validate if they were sent successfully or not :)

Hey @Laykou, I imagine it's possible with interceptors and/or observers, but you'd need to look into it more. As I mentioned earlier, I think it's outside the scope of Ahoy Email.