CHANGELOG.md 1.8 KB
Newer Older
1 2 3 4 5 6 7
*   Add `Base.unregister_interceptor`, `Base.unregister_interceptors`,
    `Base.unregister_preview_interceptor` and `Base.unregister_preview_interceptors`.
    This makes it possible to dynamically add and remove email interceptors
    at runtime in the same way they're registered.

    *Claudio Ortolina*

8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
*   Add `assert_enqueued_emails` and `assert_no_enqueued_emails`.

        def test_emails
          assert_enqueued_emails 2 do
            ContactMailer.welcome.deliver_later
            ContactMailer.welcome.deliver_later
          end
        end

        def test_no_emails
          assert_no_enqueued_emails do
            # No emails enqueued here
          end
        end

    *George Claghorn*

25 26 27 28 29
*   Add `_mailer` suffix to mailers created via generator, following the same
    naming convention used in controllers and jobs.

    *Carlos Souza*

30 31 32 33
*   Remove deprecate `*_path` helpers in email views.

    *Rafael Mendonça França*

34 35 36 37
*   Remove deprecated `deliver` and `deliver!` methods.

    *claudiob*

R
Robin Dupret 已提交
38
*   Template lookup now respects default locale and I18n fallbacks.
39

R
Robin Dupret 已提交
40
    Given the following templates:
41

R
Robin Dupret 已提交
42 43 44
        mailer/demo.html.erb
        mailer/demo.en.html.erb
        mailer/demo.pt.html.erb
45

R
Robin Dupret 已提交
46 47
    Before this change, for a locale that doesn't have its associated file, the
    `mailer/demo.html.erb` would be rendered even if `en` was the default locale.
48

R
Robin Dupret 已提交
49
    Now `mailer/demo.en.html.erb` has precedence over the file without locale.
50

R
Robin Dupret 已提交
51
    Also, it is possible to give a fallback.
52

R
Robin Dupret 已提交
53 54
        mailer/demo.pt.html.erb
        mailer/demo.pt-BR.html.erb
55

R
Robin Dupret 已提交
56 57
    So if the locale is `pt-PT`, `mailer/demo.pt.html.erb` will be rendered given
    the right I18n fallback configuration.
58

R
Robin Dupret 已提交
59
    *Rafael Mendonça França*
60

61
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionmailer/CHANGELOG.md) for previous changes.