开发者

How to put a button to action in an email template in RoR

开发者 https://www.devze.com 2023-02-16 18:09 出处:网络
My application sends notification emails 开发者_StackOverflow中文版to users, I would like to put a button in the email that links to a certain action in a controller?

My application sends notification emails 开发者_StackOverflow中文版to users, I would like to put a button in the email that links to a certain action in a controller?

When I put regular html code (like <input type="button" .... />, I get it in the received email as string, that is, I find the html code in the email) How can I skip this trap?


It's not a perfect idea to send messages as html. By default I turn off html in my email account.

Look this screencast for a beginning: http://railscasts.com/episodes/206-action-mailer-in-rails-3. You just need to specify different view formats: html or text for plain text. But in any case it will rely on reciever email settings which format will be choosen.

0

精彩评论

暂无评论...
验证码 换一张
取 消