mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
20 lines
311 B
Ruby
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
|