<commit_before># Wupee

Wupee is a simple gem which tries to fill the gap of lacking gems to manage notifications in Rails app.
Wupee is a opinionated solution which assumes that users needs to:

* be able to receive notifications in the app
* be able to receive notifications by mail
* be able to configure if they wants to either receive emails AND notifications or emails or only notifications or nothing

Right now, only the receiver can configure what he wants to receive. You can't create an *email only* notification or a *app only* notification but that could be a near future feature. 

The main object of the solution is the <strong>Wupee::Notification which stores</strong>:
* receiver (polymorphic): the recipient of the message
* attached_object (polymorphic): the subject of the notification
* notification_type_id: a reference to a Wupee::NotificationType object
* is_read: bolean

 
## Install:

To use it, add it to your Gemfile:
```ruby
gem 'wupee'
```

and bundle:
```bash
$ bundle
```

Run the generator:

```bash
$ rails g wupee:install
```

Running the generator will do a few things:

1. add the engine routes to your routes.rb:

  ```ruby
  # config/routes.rb
  mount Wupee::Engine, at: "/wupee"
  ```
2. create wupee initializer:

  ```ruby
  # config/initializers/wupee.rb
  Wupee.mailer = NotificationsMailer
  Wupee.deliver_when = :now
  ```
3. create a mailer NotificationsMailers which inheritates from Wupee::NotificationsMailer

  ```ruby
  # app/mailers/notifications_mailers.rb
  Wupee.mailer = NotificationsMailer
  Wupee.deliver_when = :now
  ```
  
4. adds wupee to your locale yml file (for email subjects)
  ```yml
  # config/locales/en.yml
  en:
    wupee:
      email_subjects:
  ```




```bash
$ rake db:migrate
```<commit_msg>filling up the readme<commit_after># Wupee

Wupee is a simple gem which tries to fill the gap of lacking gems to manage **notifications** in Rails app.
Wupee is a opinionated solution which assumes that users needs to:

* be able to receive notifications in the app
* be able to receive notifications by mail
* be able to configure if they wants to either receive emails AND notifications or emails or only notifications or nothing

Right now, only the receiver can configure what he wants to receive. You can't create an *email only* notification or a *app only* notification but that could be a near future feature. 

The main object of the solution is the <strong>Wupee::Notification which stores</strong>:
* receiver (polymorphic): the recipient of the message
* attached_object (polymorphic): the subject of the notification
* notification_type_id: a reference to a Wupee::NotificationType object
* is_read: bolean

 
## Install:

To use it, add it to your Gemfile:
```ruby
gem 'wupee'
```

and bundle:
```bash
$ bundle
```

Run the generator, install migrations and migrate:

```bash
$ rails g wupee:install
$ rake wupee:install:migrations
$ rake db:migrate
```

Running the generator will do a few things:

1. add the engine routes to your routes.rb:

  ```ruby
  # config/routes.rb
  mount Wupee::Engine, at: "/wupee"
  ```
2. create wupee initializer:

  ```ruby
  # config/initializers/wupee.rb
  Wupee.mailer = NotificationsMailer
  Wupee.deliver_when = :now
  ```
3. create a mailer NotificationsMailers which inheritates from Wupee::NotificationsMailer

  ```ruby
  # app/mailers/notifications_mailers.rb
  Wupee.mailer = NotificationsMailer
  Wupee.deliver_when = :now
  ```
  
4. adds wupee to your locale yml file (for email subjects)
  ```yml
  # config/locales/en.yml
  en:
    wupee:
      email_subjects:
  ```
{'fraction_non_alphanumeric': 0.08277777777777778, 'fraction_numerical': 0.0022222222222222222, 'mean_word_length': 4.196248196248196, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6008837', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1056, 'n_words': 454}