Method: EmailNotification#add_notification_tracker

Defined in:
lib/app/models/email_notification.rb

#add_notification_tracker(html_message) ⇒ Object



215
216
217
218
219
220
221
# File 'lib/app/models/email_notification.rb', line 215

def add_notification_tracker(html_message)
  tracker_url = "#{SystemConfiguration.base_url}/notifications/#{id}/img"
  return html_message if html_message.include?(tracker_url)

  image_tag = "<img style='height:0;width:0;border:none;display:none;' src='#{tracker_url}' alt=''/></body>"
  html_message.sub(%r{<\/body>}, image_tag)
end