Using ActionMailer for internal messaging

Rendering internal messages inline can be quite confusing, especially if you want to use some helpers inside (like path helpers). It’d be more convenient to render them in the same way as other messages – using ActionMailer and ERB templates. My solution uses email addresses to figure out the message recipients:

Additionally you can notify the user about a new message, by implementing a simple callback in the Message model.