Class: Notifications::StartedSharing

Inherits:
Notification show all
Defined in:
app/models/notifications/started_sharing.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Notification

concatenate_or_create, create_notification, #email_the_user, for, #linked_object, #set_read_state

Methods included from Diaspora::Fields::Guid

included, #set_guid

Class Method Details

.notify(contact, _recipient_user_ids) ⇒ Object


13
14
15
16
# File 'app/models/notifications/started_sharing.rb', line 13

def self.notify(contact, _recipient_user_ids)
  sender = contact.person
  create_notification(contact.user, sender, sender).try(:email_the_user, sender, sender)
end

Instance Method Details

#contactObject


18
19
20
# File 'app/models/notifications/started_sharing.rb', line 18

def contact
  recipient.contact_for(target)
end

#mail_jobObject


5
6
7
# File 'app/models/notifications/started_sharing.rb', line 5

def mail_job
  Workers::Mail::StartedSharing
end

9
10
11
# File 'app/models/notifications/started_sharing.rb', line 9

def popup_translation_key
  "notifications.started_sharing"
end