CHANGELOG.md 1.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
*   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*

18 19 20 21 22
*   Add `_mailer` suffix to mailers created via generator, following the same
    naming convention used in controllers and jobs.

    *Carlos Souza*

23 24 25 26
*   Remove deprecate `*_path` helpers in email views.

    *Rafael Mendonça França*

27 28 29 30
*   Remove deprecated `deliver` and `deliver!` methods.

    *claudiob*

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

R
Robin Dupret 已提交
33
    Given the following templates:
34

R
Robin Dupret 已提交
35 36 37
        mailer/demo.html.erb
        mailer/demo.en.html.erb
        mailer/demo.pt.html.erb
38

R
Robin Dupret 已提交
39 40
    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.
41

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

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

R
Robin Dupret 已提交
46 47
        mailer/demo.pt.html.erb
        mailer/demo.pt-BR.html.erb
48

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

R
Robin Dupret 已提交
52
    *Rafael Mendonça França*
53

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