Class: Cats::Core::DispatchNotification

Inherits:
Noticed::Base
  • Object
show all
Defined in:
app/notifications/cats/core/dispatch_notification.rb

Instance Method Summary collapse

Instance Method Details

#messageObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/notifications/cats/core/dispatch_notification.rb', line 8

def message
  dispatch = params[:dispatch]
  commodity = dispatch.dispatch_plan_item.commodity
  title = "Dispatch Notification - #{commodity.name}"
  date = Date.today
  body = "    Commodity with the following details has been dispatched to you:\n        Authorization no. = \#{dispatch.dispatch_plan_item.reference_no}\n        Dispatch Ref. = \#{dispatch.reference_no}\n        Shipping Ref. = \#{commodity.shipping_reference}\n        Batch No. = \#{commodity.batch_no}\n        Commodity = \#{commodity.name}\n        Allocated Quantity = \#{dispatch.dispatch_plan_item.quantity}\n        Quantity = \#{dispatch.quantity}\n        Unit = \#{dispatch.unit.abbreviation}\n        Truck Plate No. = \#{dispatch.plate_no}\n        Driver Name = \#{dispatch.driver_name}\n        Driver Phone = \#{dispatch.driver_phone}\n  BODY\n  {title: title, date: date, body: body}\nend\n"