Last active
December 11, 2015 23:38
-
-
Save romansklenar/4678027 to your computer and use it in GitHub Desktop.
custom Devise mailer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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