%h3.pb-2#triggered-email-overview Automated Messages

%table.table.table-striped
  %caption
    %ul
      %li.mb-1
        Recipient updates that match a given event will be sent the corresponding email(s) automatically.
        %br
        For example, when a user moves from the "Accepted" to "RSVP Confirmed" state, the user will be sent an email for the "RSVP Confirmed" event.
      %li Hard-coded emails are those managed in the source code repository, and cannot be disabled.
  %thead
    %tr
      %th Automation Event
      %th Hard-coded Email
      %th Automated Emails
  %tbody
    - Message::POSSIBLE_TRIGGERS.keys.each do |trigger|
      %tr
        %td= Message::POSSIBLE_TRIGGERS[trigger]
        - messages = Message.automated.where(trigger: trigger).all
        %td
          = ['questionnaire.pending'].include?(trigger) ? '<strong class="text-info">Hard-coded</strong>'.html_safe : 'No'
        %td
          - if messages.present?
            %ul.list-unstyled.mb-0
              - messages.each do |message|
                %li= link_to(message.name, manage_message_path(message))
          - else
            None
    %tr
      %td Disabled
      %td N/A
      %td
        - messages = Message.automated.where(trigger: nil).all
        - if messages.present?
          %ul.list-unstyled.mb-0
            - messages.each do |message|
              %li= link_to(message.name, manage_message_path(message))
        - else
          None

%h3.pb-2#triggered-email-overview Automated Messages

%table.table.table-striped
  %caption
    %ul
      %li.mb-1
        Recipient updates that match a given event will be sent the corresponding email(s) automatically.
        %br
        For example, when a user moves from the "Accepted" to "RSVP Confirmed" state, the user will be sent an email for the "RSVP Confirmed" event.
      %li Hard-coded emails are those managed in the source code repository, and cannot be disabled.
  %thead
    %tr
      %th Automation Event
      %th Message(s)
  %tbody
    - Message::POSSIBLE_TRIGGERS.keys.each do |trigger|
      %tr
        %td= Message::POSSIBLE_TRIGGERS[trigger]
        - messages = Message.automated.where(trigger: trigger).all
        %td
          - if messages.present?
            %ul.list-unstyled.mb-0
              - messages.each do |message|
                %li= link_to(message.name, manage_message_path(message))
          - else
            None
    %tr
      %td Disabled
      %td
        - messages = Message.automated.where(trigger: nil).all
        - if messages.present?
          %ul.list-unstyled.mb-0
            - messages.each do |message|
              %li= link_to(message.name, manage_message_path(message))
        - else
          None

Remove hard-coded column from triggered email summary
Remove hard-coded column from triggered email summary
