These are chat archives for mailboxer/mailboxer

30th
Oct 2014
Johan Baaij
@johan010
Oct 30 2014 18:51
hi. Is it possible to set the notified_object for notifications of the type Mailboxer::Message?
also, i was wondering what the notifcation_code column does?
Alex Sears
@searsaw
Oct 30 2014 19:03

I don’t believe there is a way to attach an object to a message. Not formally that is. However, the send_message method on the Messageable object returns the receipt for the sender’s message. So you could do something like:

something = SomeObject.new
receipt = user.send_message(put, params, here)
receipt.message.notified_object = something
receipt.save!

I haven’t tested this, but I believe it will work for ya.

Johan Baaij
@johan010
Oct 30 2014 19:06
right! that looks great, thanks heaps :)
will let you know if it works