Class: SimpleTeams::BulkInvitationsNotification
- Inherits:
-
ApplicationNotification
- Object
- Noticed::Base
- ApplicationNotification
- SimpleTeams::BulkInvitationsNotification
- Defined in:
- app/notifications/simple_teams/bulk_invitations_notification.rb
Instance Method Summary collapse
- #invitation_names ⇒ Object
- #link_text ⇒ Object
- #message ⇒ Object
- #subject ⇒ Object
-
#team ⇒ Object
Objects.
-
#team_name ⇒ Object
Names (fallback).
- #url ⇒ Object
- #user ⇒ Object
- #user_name ⇒ Object
Instance Method Details
#invitation_names ⇒ Object
38 39 40 |
# File 'app/notifications/simple_teams/bulk_invitations_notification.rb', line 38 def invitation_names params[:invitation_names] end |
#link_text ⇒ Object
20 21 22 |
# File 'app/notifications/simple_teams/bulk_invitations_notification.rb', line 20 def link_text "View Invitations" end |
#message ⇒ Object
6 7 8 |
# File 'app/notifications/simple_teams/bulk_invitations_notification.rb', line 6 def "#{user_name} invited #{invitation_names.to_sentence} to #{team_name}." end |
#subject ⇒ Object
10 11 12 |
# File 'app/notifications/simple_teams/bulk_invitations_notification.rb', line 10 def subject "Users Invited" end |
#team ⇒ Object
Objects
25 26 27 |
# File 'app/notifications/simple_teams/bulk_invitations_notification.rb', line 25 def team Team.find_by(id: params[:team_id]) end |
#team_name ⇒ Object
Names (fallback)
34 35 36 |
# File 'app/notifications/simple_teams/bulk_invitations_notification.rb', line 34 def team_name team.present? ? team.name : params[:team_name] end |
#url ⇒ Object
14 15 16 17 18 |
# File 'app/notifications/simple_teams/bulk_invitations_notification.rb', line 14 def url if team.present? and team.members.include? recipient "/teams/#{team.id}" end end |
#user ⇒ Object
29 30 31 |
# File 'app/notifications/simple_teams/bulk_invitations_notification.rb', line 29 def user SimpleTeams.member_class.find_by(id: params[:user_id]) end |
#user_name ⇒ Object
42 43 44 45 46 47 48 |
# File 'app/notifications/simple_teams/bulk_invitations_notification.rb', line 42 def user_name if recipient.id == params[:user_id] "You" else user.present? ? user.full_name : params[:user_name] end end |