demarches-normaliennes/app/helpers/email_helper.rb

13 lines
328 B
Ruby
Raw Normal View History

module EmailHelper
def event_color_code(email_events)
unique_events = email_events.map(&:event)
if unique_events.include?('delivered')
return 'email-sent'
elsif unique_events.include?('blocked') || unique_events.include?('hardBounces')
return 'email-blocked'
else
return ''
end
end
end