Class: NotificationMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/notification_mailer.rb

Instance Method Summary collapse

Instance Method Details

#notify(notification) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/mailers/notification_mailer.rb', line 4

def notify(notification)
  @metadata = notification.
  @notification = notification
  @object = notification.object
  @to = notification.target
  @type = notification.type

  # Postmark metadatas
  ['user-id-to'] = notification.target.id

  mail(
    to: "<#{notification.target.email}>",
    from: "JOGL - Just One Giant Lab <notifications@#{Rails.configuration.email}>",
    subject: notification.subject_line,
    template_path: 'notification_mailer',
    template_name: 'notification',
    tag: notification.type,
    message_stream: 'notifications' # Postmark
  )
end