| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
Documentation for ActionMailer's SMTP over SSL/TLS option
[ci skip]
|
| |
| |
| |
| |
| |
| |
| |
| | |
Add missing bullet point to make clear this is
actually a separate option from
`:openssl_verify_mode`.
Add `:ssl/:tls`-option to guides as well [ci skip]
|
|\ \
| | |
| | |
| | |
| | | |
betesh/avoid-misleading-error-about-late-attachments
Prevent reading inline attachments after `mail` was called from raising an inaccurate exception
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
inaccurate exception
Without this change, `attachments.inline['my_attachment'].present?`, for example,
would raise the exception `Can't add attachments after mail was called`.
I first brought this issue up at https://github.com/rails/rails/issues/16163#issuecomment-437378347.
Note that this commit addresses only one of the 2 problems I described in that comment.
The other problem is that using `attachments.inline['my_attachment']` for reading an
attachment is unnecessary--it's the same as `attachments['my_attachment']`--even before
`mail` is called. We could add a warning about the unnecessary use of `inline` but I'm
saving that for a later PR since my comment has not received any feedback yet.
|
|/
|
|
|
|
|
|
|
|
|
| |
We sometimes say "✂️ newline after `private`" in a code review (e.g.
https://github.com/rails/rails/pull/18546#discussion_r23188776,
https://github.com/rails/rails/pull/34832#discussion_r244847195).
Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style
`EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059).
That cop and enforced style will reduce the our code review cost.
|
| |
|
|\
| |
| |
| | |
v6.0.0.beta3 release
|
| |
| |
| |
| |
| |
| |
| | |
* Update RAILS_VERSION
* Bundle
* rake update_versions
* rake changelog:header
|
|\ \
| | |
| | | |
Ruby 2.7 warning: creating a Proc without a block
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As of [Revision 66772](
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/trunk/revisions/66772)
`Proc.new` without giving a block emits `warning: tried to create Proc object without a block`.
This commit fixes cases where Rails test suit tickles this warning.
See CI logs:
https://travis-ci.org/rails/rails/jobs/487205819#L1161-L1190
https://travis-ci.org/rails/rails/jobs/487205821#L1154-1159
https://travis-ci.org/rails/rails/jobs/487205821#L1160-L1169
https://travis-ci.org/rails/rails/jobs/487205821#L1189
https://travis-ci.org/rails/rails/jobs/487254404#L1307-L1416
https://travis-ci.org/rails/rails/jobs/487254405#L1174-L1191
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously this used self.formats= to set the format which render would
use to find templates. This worked, but was untested, and looked a
little confusing because it was doing the mutation within a loop.
This commit replaces the assignment with passing formats: [format] into
the render call, which makes it more obvious that that's the purpose of
the format. It also adds a test to verify the formats being used.
|
| |/
|/| |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Templates only have one format. Before this commit, templates would be
constructed with a single element array that contained the format. This
commit eliminates the single element array and just implements a
`format` method. This saves one array allocation per template.
|
| | |
|
|/
|
|
|
|
| |
Since production applications typically run with log level info and
email adresses should be considered as sensitive data we want to prevent
them from ending up in the logs. In development mode (with log level
debug) they are still logged as part of the Mail::Message object.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Add `MailDeliveryJob` for delivering both regular and parameterized mail.
Deprecate using `DeliveryJob` and `Parameterized::DeliveryJob`.
|
|
|
|
|
| |
Deliver parameterized mail with `ActionMailer::DeliveryJob`
and remove `ActionMailer::Parameterized::DeliveryJob`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- If a Mail defines a custom delivery_job, all ActionMailer assertion
helper (assert_emails, assert_enqueued_emails ...) wouldn't work.
```ruby
MyMailer < ApplicationMailer
self.delivery_job = MyJob
end
# This assertion will fail
assert_emails(1) do
MyMailer.my_mail.deliver_later
end
This PR leverage the new ActiveJob feature that accepts Procs for the
`only` keyword and check if the delivery job is one of ActionMailer
registered ones.
|
|\
| |
| |
| | |
ActionMailer: support overriding template name in multipart
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Implicit rendering in multipart blocks now also uses the template
name from the options hash instead of always using the action name.
So you can now write
mail(template_name: template_name) do |format|
format.text
format.html
end
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Setting parameterized_delivery_job on a mailer class will cause Parameterized::MessageDelivery to use
the specified job instead of ActionMailer::Parameterized::DeliveryJob:
class MyMailer < ApplicationMailer
self.parameterized_delivery_job = MyCustomDeliveryJob
...
end
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since Rails 6.0 will support Ruby 2.4.1 or higher
`# frozen_string_literal: true` magic comment is enough to make string object frozen.
This magic comment is enabled by `Style/FrozenStringLiteralComment` cop.
* Exclude these files not to auto correct false positive `Regexp#freeze`
- 'actionpack/lib/action_dispatch/journey/router/utils.rb'
- 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb'
It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333
Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed.
* Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required
- 'actionpack/test/controller/test_case_test.rb'
- 'activemodel/test/cases/type/string_test.rb'
- 'activesupport/lib/active_support/core_ext/string/strip.rb'
- 'activesupport/test/core_ext/string_ext_test.rb'
- 'railties/test/generators/actions_test.rb'
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As @dhh brings up, the point of `ActionDispatch::IntegrationTest` is to
allow users to test the integration of all the pieces called by a
controller. Asserting about the emails and jobs queued is part of that
task.
This commit includes the `ActionMailer::TestHelper` and
`ActiveJob::TestHelper` modules when the ActionMailer and ActiveJob
railties are initialized respectively.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use attr_reader/attr_writer instead of methods
method is 12% slower
Use flat_map over map.flatten(1)
flatten is 66% slower
Use hash[]= instead of hash.merge! with single arguments
merge! is 166% slower
See https://github.com/rails/rails/pull/32337 for more conversation
|
| |
| |
| |
| | |
`assert_no_emails` is shortcut for `assert_emails 0, &block`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* ActionMailer::Base can unregister observer(s) and interceptor(s).
One or multiple mail observers can be unregistered using
`ActionMailer::Base.unregister_observers` or
`ActionMailer::Base.unregister_observer`.
One or multiple mail interceptors can be unregistered using
`ActionMailer::Base.unregister_interceptors` or
`ActionMailer::Base.unregister_interceptor`.
For preview interceptors, it's possible to use
`ActionMailer::Base.unregister_preview_interceptors` or
`ActionMailer::Base.unregister_preview_interceptor`.
* Ensure to be reset registered observer(s) and interceptor(s)
* Add explanation to CHANGELOG
* Add original author's name
[Kota Miyake + Rafael Mendonça França + Claudio Ortolina]
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Eager autoload mail gem when eager load is true
We had a production issue where our Sidekiq worker threads all became
deadlocked while autoloading a file within the mail gem, required via
ActionMailer, despite setting our Rails applicaiton to eager load.
`Mail.eager_autoload!` exists and works great, ActionMailer just doesn't
call it during eager loading. Adding it to the ActionMailer Railtie's
eager_load_namespaces takes care of calling `Mail.eager_autoload!`
during the `eager_load!` initializer.
* 'Mail' isn't defined yet, use before_eager_load instead
* Make sure mail is loaded
* Move eager load of Mail into ActionMailer.eager_load!
[Samuel Cochran + Rafael Mendonça França]
|
| |
| |
| |
| | |
In the previous code incorrectly removes intermediate words.
|
|\ \
| | |
| | |
| | |
| | | |
Small doc fixes
[ci skip]
|
| | |
| | |
| | |
| | | |
[ci skip]
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| | |
- Remove extra execution of `perform_enqueued_jobs`
since it performs all enqueued jobs in the duration of the block.
- Fix example of using `assert_emails` without block since we
can't use enqueued jobs in this case.
|
| |
| |
| |
| | |
Perform enqueued delivery jobs in #assert_emails and #assert_no_emails.
|
| |
| |
| |
| | |
:tada::tada::tada:
|
|\ \
| | |
| | |
| | | |
Fix actionmailer lambda default
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
PR #29270 changed the number of arguments that gets passed to Procs
defined in ActionMail::Base.default. With this changeset, Procs can
now have 1 or 0 arguments
Also adds test coverage for AM::Base.default Proc arity.
|
| | |
| | |
| | |
| | | |
[ci skip]
|
| | |
| | |
| | |
| | |
| | |
| | | |
- And move the Active Job related section down. Otherwise it was
appearing as if the options are available for the `delivery_job`
setting.
|
| | | |
|
| | | |
|