mailboxer | A Rails gem to send messages inside a web application

 by   mailboxer Ruby Version: v0.12.5 License: MIT

kandi X-RAY | mailboxer Summary

kandi X-RAY | mailboxer Summary

mailboxer is a Ruby library. mailboxer has no vulnerabilities, it has a Permissive License and it has medium support. However mailboxer has 10 bugs. You can download it from GitHub.

This project is based on the need for a private message system for ging / social_stream. Instead of creating our core message system heavily dependent on our development, we are trying to implement a generic and potent messaging gem. After looking for a good gem to use we noticed the lack of messaging gems and functionality in them. Mailboxer tries to fill this void delivering a powerful and flexible message system. It supports the use of conversations with two or more participants, sending notifications to recipients (intended to be used as system notifications “Your picture has new comments”, “John Doe has updated his document”, etc.), and emailing the messageable model (if configured to do so). It has a complete implementation of a Mailbox object for each messageable with inbox, sentbox and trash. The gem is constantly growing and improving its functionality. As it is used with our parallel development ging / social_stream we are finding and fixing bugs continously. If you want some functionality not supported yet or marked as TODO, you can create an issue to ask for it. It will be great feedback for us, and we will know what you may find useful in the gem. Mailboxer was born from the great, but outdated, code from lpsergi / acts_as_messageable. We are now working to make exhaustive documentation and some wiki pages in order to make it even easier to use the gem to its full potential. Please, give us some time if you find something missing or ask for it. You can also find us on the Gitter room for this repo. Join us there to talk.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mailboxer has a medium active ecosystem.
              It has 1645 star(s) with 461 fork(s). There are 46 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 135 open issues and 207 have been closed. On average issues are closed in 507 days. There are 17 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of mailboxer is v0.12.5

            kandi-Quality Quality

              mailboxer has 10 bugs (0 blocker, 0 critical, 10 major, 0 minor) and 19 code smells.

            kandi-Security Security

              mailboxer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              mailboxer code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              mailboxer is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              mailboxer releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              mailboxer saves you 1591 person hours of effort in developing the same functionality from scratch.
              It has 3538 lines of code, 157 functions and 80 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed mailboxer and discovered the below as its top functions. This is intended to give you an instant insight into mailboxer implemented functionality, and help decide if they suit your requirements.
            • send the message to the set
            • Invoke receipt .
            • Get a conversation list of recipients
            • Send the email
            • configure the mailer method
            • Return the mailer from the client .
            Get all kandi verified functions for this library.

            mailboxer Key Features

            No Key Features are available at this moment for mailboxer.

            mailboxer Examples and Code Snippets

            No Code Snippets are available at this moment for mailboxer.

            Community Discussions

            QUESTION

            How to query the Noticed gem json field
            Asked 2021-May-14 at 21:54

            I am using Noticed gem for my notifications and I am trying to query for the notifications related to the post. The notification stores the post as an object inside params.

            ...

            ANSWER

            Answered 2021-May-14 at 18:56

            It seems the gem creates either a jsonb or json column depending on your db. So what want is perform a search on a json(b) column

            For postgres for example it can be done like this

            Source https://stackoverflow.com/questions/67539518

            QUESTION

            How to add a new participant to existing conversation in mailboxer?
            Asked 2021-Apr-04 at 07:53

            I would like to add a new participant(not current_user) to one of my conversations.

            I created a conversation with

            ...

            ANSWER

            Answered 2021-Apr-04 at 07:53

            I just found a method in source code, which does the job.

            Source https://stackoverflow.com/questions/66939030

            QUESTION

            ArgumentError (Relation passed to #or must be structurally compatible. Incompatible values: [:select])
            Asked 2019-Aug-08 at 20:41

            This works...

            ...

            ANSWER

            Answered 2019-Aug-08 at 20:26

            While I cannot answer your actual question as to why these are incompatible I can offer a solution akin to your raw SQL example.

            You can perform the same operation like so

            Source https://stackoverflow.com/questions/57418957

            QUESTION

            How can I set the user_type in the mailboxer_notifications table?
            Asked 2019-May-14 at 21:16

            My problem is that when users reply to each other, it's hard examine the database via SQL and differentiate between user types (so admin, and individual users). The default is just "User", as a string.

            When examining the mailboxer code, I know it calls the "reply" method in the Conversations controller. This is the relevant part of the code:

            ...

            ANSWER

            Answered 2019-May-14 at 21:16

            In the code you proposed, you are calling sender_type on the array of messages, but that method exists on the Mailboxer::Message model. As it's a polymorphic association see code of model here, the sender of the Mailboser::Message will be the user that was used for creating the message (in this case current_user).

            So I guess what you are looking for, is to get the user_type of your sender for a specific message of a conversation.

            So this is can be done, by doing the following (in this example let's get the user_type of the user that sent the first message of a given conversation :

            Source https://stackoverflow.com/questions/56128061

            QUESTION

            How can I have an "unread message" next to each message show in the inbox section of the mailbox?
            Asked 2019-Jan-25 at 01:09

            Question: How can I have a 'Message not read' appear next to each message within my inbox?

            I have created an internal mailing system for my app, using the mailboxer gem. My issue is when I go into the inbox section, and view all the messages that have been sent to my user account, I want to be able to see which messages I have not read.

            My code:

            ...

            ANSWER

            Answered 2019-Jan-25 at 01:09

            actually mailboxer has method in conversation record is_unread?(current_user) you can use it for your task above

            below for example your conversations controller

            Source https://stackoverflow.com/questions/54357278

            QUESTION

            How can I have the recipient field default to specific users?
            Asked 2019-Jan-24 at 02:00

            QUESTION: How can I have the recipient field, automatically filled out, with a user's username, for example, using the MailBoxer gem?

            I have a user admin account, and I want to have the recipient field pre-filled out, when I click on a user (non admin) profile page, in the show.html.erb view.

            Currently, the code used displays ALL users utilising the platform, whereas I want this specific form to only display the recipient.

            I am using the mailboxer gem, and I have the subject and message field already pre-filled and working.

            The code for the form, which is in the show.html.erb view:

            ...

            ANSWER

            Answered 2019-Jan-24 at 02:00

            you can use attribute selected :selected => @user.id (based your code above you have @user)

            Source https://stackoverflow.com/questions/54337763

            QUESTION

            Adding more send options using the mailboxer gem in rails
            Asked 2018-Nov-10 at 01:55

            I am using the mailboxer gem in rails for an app. It shows how to create a mailbox page in which I can send messages to other users. But I want to know how to add these options for other pages.

            For example, a send message button on a user's profile page (to send a message to that user).

            Allowing a user to send a message to the poster of a post/story (from the stories gem).

            etc..

            How do I do this?

            The tutorial is https://www.sitepoint.com/messaging-rails-mailboxer/

            ...

            ANSWER

            Answered 2017-Apr-23 at 08:17

            The tutorial has an addendum that covers most of what you are seeking but adds the button to the user index page. Based on the author's approach here is the answer specifically to your query. This is assuming you finished the original tutorial and it is working fine.

            In the messages_controller's 'new' action, create an instance variable called @chosen_recipient that gets the user id from a query string if it is present. The format of a query string following the path is ?key=value so something like localhost:3000/messages/new?to=1.

            Source https://stackoverflow.com/questions/43506743

            QUESTION

            (undefined method `receipts_for' for nil:NilClass - MailBoxer Gem Rails
            Asked 2018-May-29 at 13:53

            I'm using the mailboxer gem to build a messaging system between users for my rails application. For some reason, I'm getting this error:

            (undefined method `receipts_for' for nil:NilClass)

            Maybe it's because I should define 'receipts_for' somewhere in my controller or in the mailboxer.rb? I tried a few things.. but unfortunately none of them were successful.

            This is my routes.rb:

            ...

            ANSWER

            Answered 2018-May-29 at 13:53

            I’ll piggy-back on what @mu is too short said. It’s important to pay attention to the whole error message. “undefined method receipts_for for nil:NilClass” is telling you that the receiver of the receipts_for method is nil. @conversation.receipts_for(current_user) looks to be the only place where receipts_for is used, so I would start debugging by making sure @conversation is assigned the value of an existing ActiveRecord-backed conversation object.

            There seems to be too a lot going on, so I don't know how to offer you a quick fix. The value assignment in your ConversationsController#show method, @conversation= current_user.mailbox.conversation.find(params[:id]) looks cumbersome. That suggests to me that you're looking for a conversation based on a mailbox belonging to the current_user, which might be what you want (in which case, you need to have the appropriate associations defined in your models).

            However, since the chain ends with conversation.find(params[:id]), I'm guessing that current_user.mailbox is not needed. Alternatively, if your params don't actually have a conversation id, then maybe that's what you need to focus on.

            The good news is you can probably figure out how to define @conversation if you stick byebug (or binding.pry, depending on what you have installed) at the top of your show method and in your view partial:

            Source https://stackoverflow.com/questions/50571501

            QUESTION

            how to fix missing template , application/create in rails
            Asked 2018-Feb-06 at 12:16

            i keep getting this missing template error

            ...

            ANSWER

            Answered 2018-Feb-01 at 13:04

            This error comes if you're hitting the create action using HTML. create doesn't typically have an associated view; you use it to process an entity, and redirect the user elsewhere.

            Therefore, you should just be able to use:

            Source https://stackoverflow.com/questions/48562746

            QUESTION

            Mailboxer N+1 Query detected
            Asked 2017-Jul-20 at 06:08

            I managed to install Mailboxer with this tutorial but i have a recurring error :

            ...

            ANSWER

            Answered 2017-Jul-20 at 05:33

            Normally, to fix these N+1 query problems we use an includes and by passing a hash, we can includes nested associations. So looking at this code, calling receipt.message.sender is triggering the error, so we have a Receipt model, a message association on it and a sender associated to that. So if we can find where we load the Receipt we can add includes(message: :user) like we would for any other model.

            Digging into the mailboxer gem, the receipts_for method in your show action is just a wrapper for a couple of scopes on Mailboxer::Receipt. Since this method just runs some scopes for you, we can chain onto the end of it as if it were a normal ActiveRecord where chain.

            So with all that in mind, we should be able to add on our includes and avoid the N+1 query problem, ending up with something like

            Source https://stackoverflow.com/questions/45205135

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mailboxer

            Add to your Gemfile:.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mailboxer/mailboxer.git

          • CLI

            gh repo clone mailboxer/mailboxer

          • sshUrl

            git@github.com:mailboxer/mailboxer.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link