class ActionMailer::Preview
def all
def all load_previews if descendants.empty? descendants end
def call(email)
interceptors will be informed so that they can transform the message
Returns the mail object for the given email name. The registered preview
def call(email) preview = self.new message = preview.public_send(email) inform_preview_interceptors(message) message end
def email_exists?(email)
def email_exists?(email) emails.include?(email) end
def emails
def emails public_instance_methods(false).map(&:to_s).sort end
def exists?(preview)
def exists?(preview) all.any?{ |p| p.preview_name == preview } end
def find(preview)
def find(preview) all.find{ |p| p.preview_name == preview } end
def inform_preview_interceptors(message) #:nodoc:
def inform_preview_interceptors(message) #:nodoc: Base.preview_interceptors.each do |interceptor| interceptor.previewing_email(message) end end
def load_previews #:nodoc:
def load_previews #:nodoc: if preview_path Dir["#{preview_path}/**/*_preview.rb"].each{ |file| require_dependency file } end end
def preview_name
def preview_name name.sub(/Preview$/, '').underscore end
def preview_path #:nodoc:
def preview_path #:nodoc: Base.preview_path end