I am using a gem that have this e-mail method:
#Sends and email for indicating a reply in an already created conversation
def reply_message_email(message,receiver)
@message = message
@receiver = receiver
subject = message.subject.to_s
subject = strip_tags(subject) unless subject.html_safe?
mail(:to => receiver.send(Mailboxer.email_method,message), :subject => t('mailboxer.message_mailer.subject_reply', :subject => subject)) do |format|
format.text {render __method__}
format.html {render __method__}
end
end
end
And I have this in my locale:
da:
mailboxer:
message_mailer:
subject_reply: You have got a new reply "#{subject}"
Instead of overwriting the email method. Is it not possible to do some ruby code in a YAML file? Now the subject of an e-mail is just You have got a new reply “#{subject}” as text and the ruby code is not active.
Rails’ translation files don’t permit Ruby, but they do have an interpolation mechanism. Try:
See http://guides.rubyonrails.org/i18n.html#passing-variables-to-translations for more details.