2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00
discourse/app/serializers/admin_email_template_serializer.rb

20 lines
311 B
Ruby
Raw Normal View History

class AdminEmailTemplateSerializer < ApplicationSerializer
attributes :id, :title, :subject, :body
def id
object
end
def title
object.gsub(/.*\./, '').titleize
end
def subject
I18n.t("#{object}.subject_template")
end
def body
I18n.t("#{object}.text_body_template")
end
end