.email-conversations-show
.header.max-width
-# %i.material-icons mail
= link_to '[<<-]', email_conversations_path
.subject #{@email_conversation.subject}
(#{@email_conversation.email_messages.all.count})
.tags.max-width
Tags (#{@email_conversation.tags.length}):
= @email_conversation.wp_term_ids
= @email_conversation.tags.map(&:name).join(", ")
.leads.max-width
Leads (#{@email_conversation.leads.length}):
- @email_conversation.leads.each do |lead|
.item
= link_to "#{lead.id} #{lead.email}", lead_path(lead)
\(ctxs:
= link_to email_contexts_for_lead_path( lead ) do
= lead.email_contexts.count
%i.fa.fa-envelope
.relative.inline-block
%i.fa.fa-plus.expand-next
.expand-hide= render 'ish_manager/email_contexts/form', ctx: Ctx.new({ lead_id: lead.id, email_template: Tmpl.blank })
\)
.relative.inline-block
%i.fa.fa-clock-o.expand-next{ style: "color: red;" }
.expand-hide= render 'ish_manager/scheduled_email_actions/form', scheduled_email_action: Sch.new({ lead_id: lead.id })
.messages.max-width
- @email_messages.each do |msg|
- lead = msg.lead || Lead.new(email: 'NO LEAD!', id: 'no lead')
.item.msg-container{ data: { msg: { id: msg.id } } }
.row-1
.gray
%ul
%li
= msg.id
To: #{msg.to}
From: #{lead.email}
.datetime
.date= msg.date&.strftime('%Y-%m-%d')
.time= msg.date&.strftime('%l:%M%P')
.row-2
.flexy
= link_to "Expand w/img", ishapi.email_message_path(msg, jwt_token: @jwt_token, load_images: true ), target: msg.message_id, class: 'preview-btn', data: { msg: { id: msg.id.to_s } }
\- or -
= link_to "Expand", ishapi.email_message_path(msg, jwt_token: @jwt_token ), target: msg.message_id, class: 'preview-btn', data: { msg: { id: msg.id.to_s } }
= msg.preview_str
.to-expand
- if msg.attachments.present?
.attachments
- msg.attachments.map do |att|
.item
%h5= att.photo.original_filename
= image_tag att.photo.url(:original)
%iframe{ name: msg.message_id }
= render 'ish_manager/email_contexts/form_reply', lead: lead
.bordered-card
= render 'ish_manager/email_contexts/form', ctx: Ctx.new({ lead_id: lead.id, email_template: Tmpl.blank_template, from_email: msg.to, subject: msg.subject, body: (msg.part_html||msg.part_txt) }), lead: lead
-# = button_to 'Reply'
-# = button_to 'Reply All'
-# = button_to 'New Template'
-# = button_to 'Schedule Reply'
-# = render 'ish_manager/email_templates/form_schedule_mini'