class ActionMailer::Preview
def all
def all load_previews if descendants.empty? descendants end
def call(email, params = {})
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, params = {}) preview = new(params) 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)
def inform_preview_interceptors(message) Base.preview_interceptors.each do |interceptor| interceptor.previewing_email(message) end end
def initialize(params = {})
def initialize(params = {}) @params = params end
def load_previews
def load_previews if preview_path Dir["#{preview_path}/**/*_preview.rb"].sort.each { |file| require_dependency file } end end
def preview_name
def preview_name name.delete_suffix("Preview").underscore end
def preview_path
def preview_path Base.preview_path end
def show_previews
def show_previews Base.show_previews end