CHANGELOG.md 1.9 KB
Newer Older
1 2 3 4 5
*   Mailer preview now uses `url_for` to fix links to emails for apps running on
    a subdirectory.

    *Remo Mueller*

6 7 8 9 10 11 12
*   Mailer previews no longer crash when the `mail` method wasn't called
    (`NullMail`).

    Fixes #19849.

    *Yves Senn*

13 14 15 16
*   Make sure labels and values line up in mailer previews.

    *Yves Senn*

17 18
*   Add `assert_enqueued_emails` and `assert_no_enqueued_emails`.

Y
Yves Senn 已提交
19 20
    Example:

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
        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*

36 37 38 39 40
*   Add `_mailer` suffix to mailers created via generator, following the same
    naming convention used in controllers and jobs.

    *Carlos Souza*

41 42 43 44
*   Remove deprecate `*_path` helpers in email views.

    *Rafael Mendonça França*

45 46 47 48
*   Remove deprecated `deliver` and `deliver!` methods.

    *claudiob*

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

R
Robin Dupret 已提交
51
    Given the following templates:
52

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

R
Robin Dupret 已提交
57 58
    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.
59

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

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

R
Robin Dupret 已提交
64 65
        mailer/demo.pt.html.erb
        mailer/demo.pt-BR.html.erb
66

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

R
Robin Dupret 已提交
70
    *Rafael Mendonça França*
71

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