Mailboxer v0.14.0 Release Notes

Release Date: 2016-07-29 // over 7 years ago
  • โž• Added

    • ๐Ÿš… Rails 5 compatibility.

    ๐Ÿ›  Fixed

    • Mailboxer::Message object no longer requires to have a subject.
    • Objects are now saved before mails are sent, you you can use them in the ๐Ÿ— mailer templates (to build URLs, for example).

    ๐Ÿ”„ Changed

    • Errors are now stored in the parent message/notification instead of being stored in the sender receipt. That means you need handle mailboxer related โฌ†๏ธ controller and views differently, and study the upgrade case by case (propably by having a look at mailboxer's source code). As an example, if you were previously doing something like this in your controller:
    @receipt = @actor.send_message(@recipients, params[:body], params[:subject])
    if (@receipt.errors.blank?)
      @conversation = @receipt.conversation
      redirect_to conversation_path(@conversation)
    else
      render :action => :new
    end
    

    you now need to do something like

    @receipt = @actor.send_message(@recipients, params[:body], params[:subject])
    @message = @receipt.message
    if (@message.errors.blank?)
      @conversation = @message.conversation
      redirect_to conversation_path(@conversation)
    else
      render :action => :new
    end
    

    ๐Ÿ— This might look more complicated at first but allows you to build more RESTful ๐Ÿ— resources since you can build forms on messages and/or conversations and directly show errors on them. Less specially handling is now required to propagate errors around models.