mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 02:20:41 +08:00
de011b53b5
For example, webhooks mark email log entries as bounced without there ever being an incoming email.
23 lines
520 B
Ruby
23 lines
520 B
Ruby
class EmailLogSerializer < ApplicationSerializer
|
|
include EmailLogsMixin
|
|
|
|
attributes :reply_key,
|
|
:bounced,
|
|
:has_bounce_key
|
|
|
|
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
|