Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

notification on email delivery failure with action mailer in rails

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

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

Is it possible for the controller to get notified if the message was delivered properly to the :to email address ,so that it will be possible to notify the sender about the email notification failure ?

Thanks.

like image 777
Prabesh Shrestha Avatar asked Feb 24 '23 17:02

Prabesh Shrestha


2 Answers

You can't check to see if somebody's received an email, but you can check to see if they've opened it. Email services these days use a small 1x1px image which contains some values in the query parameters to associate it to the user.

Other than that, no.

like image 109
Ryan Bigg Avatar answered Apr 27 '23 23:04

Ryan Bigg


The deliver operation applied to a mail object will raise an error if the mail service it uses (e.g. mailgun) refuses it. I assume it's possible to rescue that error but haven't succeeded yet.

like image 22
user1461979 Avatar answered Apr 27 '23 23:04

user1461979