是否可以查看是否已通过条件发送电子邮件。我想显示两个不同的警报,具体取决于是否已发送电子邮件。尝试的代码在下面,但为actionmailer获取未定义的方法成功。
for update
答案 0 :(得分:0)
Is it possible to see if an email has been delivered in a rails if condition.
The short answer is "No".
The basic email protocol does not have any mechanism which requires acknowledgement of receipt built in to it, and once the email has left you, its no longer in your control.
The alternative mechanism requires crafting an email with images (often, but not always a 1x1 clear pixel), with a unique name hosted on a web server. If and when the mail client opens the image, the web server can track that the image has been sent. This mechanism is often used by mailing lists - and, of-course, mail clients can be configured not to open off-site images or 1x1 images etc.