This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/serializers/admin_email_template_serializer.rb

20 lines
311 B
Ruby

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