CHANGELOG.md 2.3 KB
Newer Older
1 2 3 4 5
*   Add `config.action_mailer.deliver_later_queue_name` configuration to set the
    mailer queue name.

    *Chris McGrath*

6 7 8 9 10
*   `assert_emails` in block form use the given number as expected value.
    This makes the error message much easier to understand.

    *Yuji Yaginuma*

11 12 13 14 15
*   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*

16 17 18 19 20
*   Mailer preview now uses `url_for` to fix links to emails for apps running on
    a subdirectory.

    *Remo Mueller*

21 22 23 24 25 26 27
*   Mailer previews no longer crash when the `mail` method wasn't called
    (`NullMail`).

    Fixes #19849.

    *Yves Senn*

28 29 30 31
*   Make sure labels and values line up in mailer previews.

    *Yves Senn*

32 33
*   Add `assert_enqueued_emails` and `assert_no_enqueued_emails`.

Y
Yves Senn 已提交
34 35
    Example:

36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
        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*

51 52 53 54 55
*   Add `_mailer` suffix to mailers created via generator, following the same
    naming convention used in controllers and jobs.

    *Carlos Souza*

56 57 58 59
*   Remove deprecate `*_path` helpers in email views.

    *Rafael Mendonça França*

60 61 62 63
*   Remove deprecated `deliver` and `deliver!` methods.

    *claudiob*

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

R
Robin Dupret 已提交
66
    Given the following templates:
67

R
Robin Dupret 已提交
68 69 70
        mailer/demo.html.erb
        mailer/demo.en.html.erb
        mailer/demo.pt.html.erb
71

R
Robin Dupret 已提交
72 73
    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.
74

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

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

R
Robin Dupret 已提交
79 80
        mailer/demo.pt.html.erb
        mailer/demo.pt-BR.html.erb
81

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

R
Robin Dupret 已提交
85
    *Rafael Mendonça França*
86

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