Skip to content

Instantly share code, notes, and snippets.

@romansklenar
Last active December 11, 2015 23:38
Show Gist options
  • Save romansklenar/4678027 to your computer and use it in GitHub Desktop.
Save romansklenar/4678027 to your computer and use it in GitHub Desktop.
custom Devise mailer
class DeviseMailer < ApplicationMailer
include Devise::Mailers::Helpers
def confirmation_instructions(record)
devise_mail(record, :confirmation_instructions)
end
def reset_password_instructions(record)
devise_mail(record, :reset_password_instructions)
end
def unlock_instructions(record)
devise_mail(record, :unlock_instructions)
end
# tell mailer to look for templates in devise directory
def template_paths
template_path = _prefixes.dup
template_path.unshift "devise/mailer"
template_path.unshift "#{@devise_mapping.scoped_path}/mailer" if self.class.scoped_views?
template_path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment