문제

I'm looking for a way to include html in a mail_to link, so that I can automatically include a banner in the body of this email.

Thanks for any hints

Markus

도움이 되었습니까?

해결책

Rails 3

mail_to "email@example.com", raw(image_tag("/path/to/banner.png"))

Rails 2.x

mail_to "email@example.com", image_tag("/path/to/banner.png")

See the documentation for the mail_to helper.

다른 팁

In rails 4 with actionview-encode_mail_to you can do it like (Haml Syntax):

= mail_to 'email@example.com', encode: 'javascript' do
  = image_tag('contact_email.png')
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top