discourse/app/serializers/email_log_serializer.rb
Martin Brennan d2ddb140dd
FEATURE: Show SMTP response on admin email sent list and rearrange columns (#17143)
Follow up to 4d3c1ceb44, this commit
shows the SMTP response in the admin email sent list and also moves the
topic/post link into a new column. Reply key is now in its own column.
2022-08-03 08:11:54 +10:00

26 lines
592 B
Ruby

# frozen_string_literal: true
class EmailLogSerializer < ApplicationSerializer
include EmailLogsMixin
attributes :reply_key,
:bounced,
:has_bounce_key,
:smtp_transaction_response
has_one :user, serializer: BasicUserSerializer, embed: :objects
def include_reply_key?
reply_keys = @options[:reply_keys]
reply_keys.present? && reply_keys[[object.post_id, object.user_id]]
end
def reply_key
@options[:reply_keys][[object.post_id, object.user_id]].delete("-")
end
def has_bounce_key
object.bounce_key.present?
end
end