Class: Printos::NotificationService
- Inherits:
-
BaseService
- Object
- BaseService
- Printos::NotificationService
- Defined in:
- lib/printos/notification_service.rb
Constant Summary collapse
- API_BASE =
'api/notification-service/v1'
Class Method Summary collapse
Methods inherited from BaseService
get_resource, parse, post_resource, put_resource
Class Method Details
.send_notification(event_name, link_label, entity_id, sub_value, sub_value_params, org_id) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/printos/notification_service.rb', line 7 def self.send_notification(event_name, link_label, entity_id, sub_value, sub_value_params, org_id) Printos.config.logger.debug { "Sending notification: #{{ event_name: event_name, link_label: link_label, entity_id: entity_id, sub_value: sub_value, sub_value_params: sub_value_params, org_id: org_id}}" } body = { 'eventName': event_name, 'linkLabel': link_label, 'entityId': entity_id, 'subValue': sub_value, 'subValueParams': sub_value_params, 'orgId': org_id, 'timestamp': Time.now.utc.strftime('%Y-%m-%dT%H:%M:%S.%LZ'), } post_resource("#{API_BASE}/event/notify", body, true) end |