CHANGELOG.md 2.8 KB
Newer Older
E
eileencodes 已提交
1 2
## Rails 5.0.0.beta3 (February 24, 2016) ##

3 4 5 6 7 8
*   Add support to fragment cache in Action Mailer.

    Now you can use fragment caching in your mailers views.

    *Stan Lo*

9 10 11 12 13 14
*   Reset `ActionMailer::Base.deliveries` after every test in
    `ActionDispatch::IntegrationTest`.

    *Yves Senn*


S
Sean Griffin 已提交
15 16 17 18 19
## Rails 5.0.0.beta2 (February 01, 2016) ##

*   No changes.


20 21
## Rails 5.0.0.beta1 (December 18, 2015) ##

22
*   `config.force_ssl = true` will set
23
    `config.action_mailer.default_url_options = { protocol: 'https' }`.
24 25 26

    *Andrew Kampjes*

27 28 29 30 31
*   Add `config.action_mailer.deliver_later_queue_name` configuration to set the
    mailer queue name.

    *Chris McGrath*

32 33 34 35 36
*   `assert_emails` in block form use the given number as expected value.
    This makes the error message much easier to understand.

    *Yuji Yaginuma*

37 38 39 40 41
*   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*

42 43 44 45 46
*   Mailer preview now uses `url_for` to fix links to emails for apps running on
    a subdirectory.

    *Remo Mueller*

47 48 49 50 51 52 53
*   Mailer previews no longer crash when the `mail` method wasn't called
    (`NullMail`).

    Fixes #19849.

    *Yves Senn*

54 55 56 57
*   Make sure labels and values line up in mailer previews.

    *Yves Senn*

58 59
*   Add `assert_enqueued_emails` and `assert_no_enqueued_emails`.

Y
Yves Senn 已提交
60 61
    Example:

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
        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*

77 78 79 80 81
*   Add `_mailer` suffix to mailers created via generator, following the same
    naming convention used in controllers and jobs.

    *Carlos Souza*

82
*   Remove deprecated `*_path` helpers in email views.
83 84 85

    *Rafael Mendonça França*

86 87 88 89
*   Remove deprecated `deliver` and `deliver!` methods.

    *claudiob*

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

R
Robin Dupret 已提交
92
    Given the following templates:
93

R
Robin Dupret 已提交
94 95 96
        mailer/demo.html.erb
        mailer/demo.en.html.erb
        mailer/demo.pt.html.erb
97

R
Robin Dupret 已提交
98 99
    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.
100

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

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

R
Robin Dupret 已提交
105 106
        mailer/demo.pt.html.erb
        mailer/demo.pt-BR.html.erb
107

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

R
Robin Dupret 已提交
111
    *Rafael Mendonça França*
112

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