Guest User

Untitled

a guest
Jan 13th, 2018
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. class HelperMailer < ActionMailer::Base
  2. def use_inline_css_hook_with_only_html_part
  3. mail_with_defaults do |format|
  4. format.html { render(:inline => TEST_HTML) }
  5. end
  6. end
  7.  
  8. def use_inline_css_hook_with_text_and_html_parts
  9. mail_with_defaults do |format|
  10. format.html { render(:inline => TEST_HTML) }
  11. format.text { render(:inline => "Different Text Part") }
  12. end
  13. end
  14.  
  15. def use_inline_css_hook_with_utf_8
  16. mail_with_defaults do |format|
  17. format.html { render(:inline => TEST_HTML_UTF8) }
  18. end
  19. end
  20.  
  21. def inline_css_hook_with_base_url
  22. mail_with_defaults do |format|
  23. format.html { render(:inline => TEST_HTML_WITH_HOST) }
  24. end
  25. end
  26.  
  27. protected
  28.  
  29. def mail_with_defaults(&block)
  30. mail(:to => "test@localhost", :from => "[email protected]",
  31. :subject => "using helpers", &block)
  32. end
  33. end
Add Comment
Please, Sign In to add comment