Send out email only for cards that move into other lists

#### Some notes

I thought it was time to refactor a bit `CardsController`, since its responsibilities were about to grow (e.g. it would have known when to send out emails).

I clearly separated realtime from email sending, which should have nice side effects:

1. Group mail logic into one single class
2. Group realtime logic into one single class
3. Readability in the controller
4. Changing realtime logic, does not affect changing mail logic (and viceversa)

/cc: @exalted 
For the sake of less verbosity + "better" naming I :+1: for `CardMailSender`
:wink:


Ali


On Wed, Aug 6, 2014 at 2:56 PM, Antonio Scandurra <notifications@github.com>
wrote:

> In app/notifications/card_mail_notifier.rb:
>
> > @@ -0,0 +1,13 @@
> > +class CardMailNotifier
>
> This class is actually responsible for handling card events. In this case
> it already handles:
>
>    1. card_moved
>    2. card_created
>    3. card_archived
>
> And it handles them by delivering e-mails. I am not sure we could have a
> simple MailSender, since we need a specific handler for card emails, and
> each of these handlers will have a different logic (e.g. in this case a
> card_moved mail should be sent out only when a card is moved between lists).
>
> MailSenderForCardEvents looks a bit weird and maybe too verbose. What do
> you think of MailSenderForCards or CardMailSender/CardMailDeliverer
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/catchupio/catchup-web/pull/26/files#r15871057>.
>