Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionMailer get messageid for sent messages

I am writing a rails application that sends emails when certain actions occur, users can then reply to these emails and the system needs to match the reply email to the original email sent to the user.

It seems like the best way to do this is to save the message id header field when sending messages, is this possible in ActionMailer? I can then retrieve the references header from replies and match the messages.

If this is not possible are there any alternate solutions?

like image 393
Greg Avatar asked Dec 07 '22 06:12

Greg


1 Answers

With Rails 3, this is possible:

message = Mailer.welcome(@user).deliver
message.message_id #=> 4ccc56d19...

like image 172
mattwindwer Avatar answered Dec 20 '22 18:12

mattwindwer