Class: SimpleTeams::InvitationNotification
Instance Method Summary
collapse
Instance Method Details
#invitation ⇒ Object
32
33
34
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 32
def invitation
team.invitations.find_by(id: params[:invitation_id]) if team.present?
end
|
#invitation_name ⇒ Object
41
42
43
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 41
def invitation_name
invitation.present? ? invitation.email : params[:invitation_name]
end
|
#link_text ⇒ Object
19
20
21
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 19
def link_text
"View Invitations"
end
|
#message ⇒ Object
5
6
7
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 5
def message
raise NotImplemented
end
|
#subject ⇒ Object
9
10
11
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 9
def subject
raise NotImplemented
end
|
#team ⇒ Object
24
25
26
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 24
def team
Team.find_by(id: params[:team_id])
end
|
#team_name ⇒ Object
37
38
39
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 37
def team_name
team.present? ? team.name : params[:team_name]
end
|
#url ⇒ Object
13
14
15
16
17
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 13
def url
if team.present? and team.members.include? recipient
"/teams/#{team.id}"
end
end
|
#user ⇒ Object
28
29
30
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 28
def user
SimpleTeams.member_class.find_by(id: params[:user_id])
end
|
#user_name ⇒ Object
45
46
47
48
49
50
51
|
# File 'app/notifications/simple_teams/invitation_notification.rb', line 45
def user_name
if recipient.id == params[:user_id]
"You"
else
user.present? ? user.full_name : params[:user_name]
end
end
|