Simplify mailers development with mailcatcher and previews
This commit is contained in:
parent
293e24e20e
commit
29de9b0b55
2 changed files with 14 additions and 1 deletions
|
@ -39,9 +39,17 @@ Rails.application.configure do
|
|||
# Raises helpful error messages.
|
||||
config.assets.raise_runtime_errors = true
|
||||
|
||||
config.action_mailer.delivery_method = :test
|
||||
# Action Mailer settings
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
|
||||
|
||||
# Config for mailcatcher https://mailcatcher.me/
|
||||
config.action_mailer.smtp_settings = {
|
||||
:address => "localhost",
|
||||
:port => 1025,
|
||||
:locale => 'fr'
|
||||
}
|
||||
|
||||
# Raises error for missing translations
|
||||
# config.action_view.raise_on_missing_translations = true
|
||||
|
||||
|
|
5
spec/mailers/previews/notification_mailer_preview.rb
Normal file
5
spec/mailers/previews/notification_mailer_preview.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class NotificationMailerPreview < ActionMailer::Preview
|
||||
def dossier_received
|
||||
NotificationMailer.dossier_received(Dossier.last)
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue