Email Delivery Notification with Rails Handler

When I send an email to someone with an email action program in a rails 3 project

mail(:to => @email, :subject=> "subject") 

Is it possible for the controller to receive a notification if the message is correctly delivered to the email address: so that you can inform the sender of the notification error by email?

Thanks.

+4
source share
3 answers

You cannot check if someone has received an email, but you can check if he has opened it. Email services currently use a small 1x1px image that contains some values ​​in the request parameters to associate them with the user.

Other than that, no.

+5
source

The delivery operation applied to the mail object will cause an error if the mail service used (for example, mailgun) refuses it. I assume that this error can be saved, but so far failed.

+2
source

ActionMailer does not do this in its essence, but using a third-party delivery service such as MailChimp, you can request their API (mandrill) and ask for delivery confirmation and "opening".

You can then extend ActionMailer to enable hooks for these APIs and thus receive a notification. The operation will be very asynchronous, and I do not use people who store and re-create an instance of the ActionMailer object. Feedback on this is welcome.

+1
source

Source: https://habr.com/ru/post/1344743/


All Articles