CHANGELOG.md 2.4 KB
Newer Older
1 2 3 4 5 6
*   `deliver_later` now respects the current locale.

    Fixes #20774.

    *Johannes Opper*

7 8 9 10 11
*   Add `config.action_mailer.deliver_later_queue_name` configuration to set the
    mailer queue name.

    *Chris McGrath*

12 13 14 15 16
*   `assert_emails` in block form use the given number as expected value.
    This makes the error message much easier to understand.

    *Yuji Yaginuma*

17 18 19 20 21
*   Add support for inline images in mailer previews by using an interceptor
    class to convert cid: urls in image src attributes to data urls.

    *Andrew White*

22 23 24 25 26
*   Mailer preview now uses `url_for` to fix links to emails for apps running on
    a subdirectory.

    *Remo Mueller*

27 28 29 30 31 32 33
*   Mailer previews no longer crash when the `mail` method wasn't called
    (`NullMail`).

    Fixes #19849.

    *Yves Senn*

34 35 36 37
*   Make sure labels and values line up in mailer previews.

    *Yves Senn*

38 39
*   Add `assert_enqueued_emails` and `assert_no_enqueued_emails`.

Y
Yves Senn 已提交
40 41
    Example:

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
        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*

57 58 59 60 61
*   Add `_mailer` suffix to mailers created via generator, following the same
    naming convention used in controllers and jobs.

    *Carlos Souza*

62 63 64 65
*   Remove deprecate `*_path` helpers in email views.

    *Rafael Mendonça França*

66 67 68 69
*   Remove deprecated `deliver` and `deliver!` methods.

    *claudiob*

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

R
Robin Dupret 已提交
72
    Given the following templates:
73

R
Robin Dupret 已提交
74 75 76
        mailer/demo.html.erb
        mailer/demo.en.html.erb
        mailer/demo.pt.html.erb
77

R
Robin Dupret 已提交
78 79
    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.
80

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

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

R
Robin Dupret 已提交
85 86
        mailer/demo.pt.html.erb
        mailer/demo.pt-BR.html.erb
87

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

R
Robin Dupret 已提交
91
    *Rafael Mendonça França*
92

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