Class: SpreeCmCommissioner::TicketTransferRejectedNotification
- Inherits:
-
NoticedFcmBase
- Object
- Noticed::Base
- NoticedFcmBase
- SpreeCmCommissioner::TicketTransferRejectedNotification
show all
- Defined in:
- app/notifications/spree_cm_commissioner/ticket_transfer_rejected_notification.rb
Instance Method Summary
collapse
#android_settings, #apns_settings, #cleanup_device_token, #convert_hash_values_to_str, #fcm_credentials, #fcm_device_tokens, #format_for_database, #format_notification, #image_url, #message, #payload, #title
Instance Method Details
11
12
13
14
15
16
17
18
19
|
# File 'app/notifications/spree_cm_commissioner/ticket_transfer_rejected_notification.rb', line 11
def
{
ticket_transfer_token: ticket_transfer.token,
product_name: ticket_transfer.product&.name.to_s,
notification_type: type,
title: notification_title,
message: notification_message
}
end
|
#notificable ⇒ Object
3
4
5
|
# File 'app/notifications/spree_cm_commissioner/ticket_transfer_rejected_notification.rb', line 3
def notificable
ticket_transfer
end
|
#notification_message ⇒ Object
25
26
27
28
29
30
31
|
# File 'app/notifications/spree_cm_commissioner/ticket_transfer_rejected_notification.rb', line 25
def notification_message
I18n.t(
'notifications.spree_cm_commissioner.ticket_transfer_rejected_notification.message',
product_name: ticket_transfer.product&.name.to_s,
buyer_name: ticket_transfer.to_user&.display_name.presence
)
end
|
#notification_title ⇒ Object
21
22
23
|
# File 'app/notifications/spree_cm_commissioner/ticket_transfer_rejected_notification.rb', line 21
def notification_title
I18n.t('notifications.spree_cm_commissioner.ticket_transfer_rejected_notification.title')
end
|
#push_notificable? ⇒ Boolean
44
45
46
|
# File 'app/notifications/spree_cm_commissioner/ticket_transfer_rejected_notification.rb', line 44
def push_notificable?
true
end
|
#ticket_transfer ⇒ Object
7
8
9
|
# File 'app/notifications/spree_cm_commissioner/ticket_transfer_rejected_notification.rb', line 7
def ticket_transfer
@ticket_transfer ||= SpreeCmCommissioner::TicketTransfer.find(params[:ticket_transfer_id])
end
|
#translatable_options ⇒ Object
33
34
35
36
37
38
|
# File 'app/notifications/spree_cm_commissioner/ticket_transfer_rejected_notification.rb', line 33
def translatable_options
{
product_name: ticket_transfer.product&.name.to_s,
buyer_name: ticket_transfer.to_user&.display_name.presence
}
end
|
#type ⇒ Object
40
41
42
|
# File 'app/notifications/spree_cm_commissioner/ticket_transfer_rejected_notification.rb', line 40
def type
'ticket_transfer_rejected_notification'
end
|