Class | ActionMailer::Base |
In: |
lib/gibberish_db.rb
|
Parent: | Object |
We want .to_html to be active when invoking action mailer through the create_XXX functions so that we can edit them in the menagerie. But, we want it to be inactive through the deliver_XXX functions so that end users don‘t see the extra markup. We make that happen here.
# File lib/gibberish_db.rb, line 170 170: def method_missing_with_html_suppression(method_symbol, *parameters) 171: case method_symbol.id2name 172: when /^deliver_([_a-z]\w*)/ 173: # No HTML for mails that are being delivered 174: Gibberish::Translation.suppressing_html_wrapping do 175: method_missing_without_html_suppression(method_symbol, *parameters) 176: end 177: else 178: # Pass through for the others 179: method_missing_without_html_suppression(method_symbol, *parameters) 180: end 181: end