feat: Display sent status of emails in email channel (#3125)
This commit is contained in:
@@ -3,14 +3,14 @@ class ConversationReplyEmailWorker
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options queue: :mailers
|
||||
|
||||
def perform(conversation_id, queued_time)
|
||||
def perform(conversation_id, last_queued_id)
|
||||
@conversation = Conversation.find(conversation_id)
|
||||
|
||||
# send the email
|
||||
if @conversation.messages.incoming&.last&.content_type == 'incoming_email' || email_inbox?
|
||||
ConversationReplyMailer.with(account: @conversation.account).reply_without_summary(@conversation, queued_time).deliver_later
|
||||
if @conversation.messages.incoming&.last&.content_type == 'incoming_email'
|
||||
ConversationReplyMailer.with(account: @conversation.account).reply_without_summary(@conversation, last_queued_id).deliver_later
|
||||
else
|
||||
ConversationReplyMailer.with(account: @conversation.account).reply_with_summary(@conversation, queued_time).deliver_later
|
||||
ConversationReplyMailer.with(account: @conversation.account).reply_with_summary(@conversation, last_queued_id).deliver_later
|
||||
end
|
||||
|
||||
# delete the redis set from the first new message on the conversation
|
||||
|
||||
14
app/workers/email_reply_worker.rb
Normal file
14
app/workers/email_reply_worker.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class EmailReplyWorker
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options queue: :mailers
|
||||
|
||||
def perform(message_id)
|
||||
message = Message.find(message_id)
|
||||
|
||||
return unless message.outgoing? || message.input_csat?
|
||||
return if message.private?
|
||||
|
||||
# send the email
|
||||
ConversationReplyMailer.with(account: message.account).email_reply(message).deliver_later
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user