mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
10 lines
364 B
Ruby
10 lines
364 B
Ruby
class MailTemplate < ActiveRecord::Base
|
|
|
|
validates :name, :subject, :from, :body, :text_body, presence: true
|
|
|
|
def to_html(body)
|
|
template = Erubis::Eruby.new(content, escape: true)
|
|
template_result = template.result(context)
|
|
Sanitize.clean(RDiscount.new(template_result).to_html.encode('UTF-8', undef: :replace), Sanitize::Config::RELAXED)
|
|
end
|
|
end
|