Module: MailActivitiesHelper

Defined in:
app/helpers/mail_activities_helper.rb

Overview

== Schema Information

Table name: mail_activities

mailing_id :integer
activity_id :integer
id :integer not null, primary key
address_id :integer
service_code :string
postage_rates :hstore is an Array
actual_shipping_cost :decimal(, )
state :string

Instance Method Summary collapse

Instance Method Details



17
18
19
20
# File 'app/helpers/mail_activities_helper.rb', line 17

def add_mail_activity_shipment_link(name)
  link_to name, "#", onclick: "$('#shipments').append('#{j(render(partial: 'shipment_field', locals: { remove_link: true, package: WarehousePackage.new, shipment: Shipment.new(state: 'awaiting_label') }))}');return false",
class: 'btn btn-outline-primary'
end

#cleanup_notes_for_mail_activity(notes) ⇒ Object



22
23
24
25
26
27
28
29
# File 'app/helpers/mail_activities_helper.rb', line 22

def cleanup_notes_for_mail_activity(notes)
  s = notes.to_s
  s = s.gsub("Time lock was overdue and moved to next working day for assigned employee", '')
  s = s.gsub(/\[.*\]/, '')
  s = s.squish
  s = s.gsub("\n", '<br>')
  s.html_safe
end