Commit Graph

1047 Commits

Author SHA1 Message Date
Geremia Taglialatela
3da5267f1a Fix ActionMailer's deliver later default queue
The default queue name used by `deliver_later` is no longer `mailers`.

This commit removes the misleading information from the class
documentation

Ref: #40848
2021-03-05 10:16:55 +01:00
Rafael Mendonça França
1b455e2e9d
Rails 6.2 is now Rails 7.0
We have big plans for the next version of Rails and that
require big versions.
2021-02-04 16:47:16 +00:00
Ryuta Kamizono
2b0b5a75c0 Bump license years to 2021 [ci skip] 2021-01-01 12:21:20 +09:00
Paul Keen
7d7bd2bfba Make sure that mailers will use default job queue
Use "default" as default queue for mailers test helpers
2020-12-18 23:35:59 +02:00
Rafael Mendonça França
59f7f5889e
Start Rails 6.2 development 🎉 2020-12-03 01:35:29 +00:00
Rafael Mendonça França
8389f9902c
Preparing for 6.1.0.rc1 release 2020-11-02 21:12:47 +00:00
Ryuta Kamizono
8512213a39 Fix deprecation will be removed version s/Rails 6.1/Rails 6.2/ 2020-10-30 10:11:29 +09:00
Akira Matsuda
2013ebbd4a class_attributes are defined as public methods 2020-10-27 12:13:32 +09:00
Edouard CHIN
859f3bf024 Deprecate custom Action Mailer delivery job:
- Action Mailer delivery job should modify their `perform` method
  signature in order to receive the new payload that Action Mailer
  sends.

  Before:

  ```ruby
    def perform(mailer, mail_method, delivery_method, *args)
    end
  ```

  After:

  ```ruby
    def perform(mailer, mail_method, delivery_method, args:)
    end
  ```

  This new behaviour was introduced couple years ago in a attempt to
  get rid of the necessity to have a different job for paramterized
  mailers. A deprecation was introduced for custom jobs inheriting
  from `ActionMailer::DeliveryJob` but for jobs that didn't it went
  unnoticed.
  The deprecated behaviour was supposed to be removed in Rails 6.1
  but we couldn't and it got reverted https://github.com/rails/rails/pull/39257
2020-08-26 17:48:47 +02:00
Aaron Patterson
397693a5ea
Merge pull request #26445 from dracos/multiparty
Correctly wrap inline attachments.
2020-08-19 10:10:36 -07:00
Fabian Mersch
4dec6df5a8 Document the priority option for #deliver_later [ci skip] 2020-06-23 09:25:00 +02:00
Ryuta Kamizono
528b62e386 Address to false negative for Performance/DeletePrefix,DeleteSuffix
Follow up to c07dff72278fb7f2a3c4c71212a0773a2b25c790.

Actually it is not the cop's fault, but we mistakenly use `^`, `$`, and
`\Z` in much places, the cop doesn't correct those conservatively.

I've checked all those usage and replaced all safe ones.
2020-06-14 13:04:47 +09:00
Petrik
2b09948637 Replace 'Stubs out' with 'Generates' in generator USAGE's [ci skip]
Generators generate things, but what is meant by 'Stubbing out' might
confuse beginners and non-native English speakers.
While generated tests are stubs that should have an implementation, a
generated model is a valid model that doesn't require any changes.
2020-06-03 08:51:47 +02:00
John Hawthorn
096d143c8c Clear cache after setting Template::Types delegate
details_cache_key already references Template::Types.symbols and view
resolvers cache based on default_formats and other values. This
previously wasn't an issue because no views had been looked up before
this was set. Now that we are building a regex from the values of
Template::Types.symbols we need to clear cache after changing this
setting.
2020-05-21 22:43:13 -07:00
eileencodes
336a07b9a4
Revert "Remove deprecated ActionMailer::DeliveryJob and ActionMailer::Parameterized::DeliveryJob"
This reverts commit 0f9249c93f402d276730fcfaba1ed1b876ee7c26.

Reverted because this wasn't warning in custom jobs and therefore
applications may have not seen the deprecation. We'll need to fix the
deprecation to warn for custom jobs so that applications can migrate.
2020-05-12 15:20:07 -04:00
Rafael Mendonça França
03351cd541
Remove deprecated force_ssl at the controller level. 2020-05-05 00:58:54 -04:00
Rafael Mendonça França
0f9249c93f
Remove deprecated ActionMailer::DeliveryJob and ActionMailer::Parameterized::DeliveryJob 2020-05-05 00:31:14 -04:00
Rafael Mendonça França
d5fa9569a0
Remove deprecated ActionMailer::Base.receive in favor of Action Mailbox 2020-05-05 00:06:22 -04:00
Rafael Mendonça França
f1a2c021e3
Make _protected_ivars private
This method is only used internally and it being public it was being
retorned in the `action_methods` list.
2020-04-07 12:45:19 -04:00
Jonathan Hefner
c7b7d83f70 Heed config.force_ssl when building URL
`url_for` will now use "https://" as the default protocol when
`Rails.application.config.force_ssl` is set to true.

Action Mailer already behaves this way, effectively.  This commit
extends that behavior application-wide.

Closes #23543.
2020-04-05 18:19:31 -05:00
Eugene Kenny
9e40348645 Enable HashTransformKeys and HashTransformValues cops
Followup to 88fe76e69328d38942130e16fb65f4aa1b5d1a6b.

These are new in RuboCop 0.80.0, and enforce a style we already prefer
for performance reasons (see df81f2e5f5df46c9c1db27530bbd301b6e23c4a7).
2020-02-20 22:37:32 +00:00
aminamos
7bb0706f2c update from PR #36222 2020-02-12 13:31:43 -05:00
Ryuta Kamizono
8e452c710d Fix keyword arguments warnings in Action Mailer 2020-01-21 09:23:15 +09:00
Ryuta Kamizono
99f18b618b Revert "Merge pull request #38260 from kamipo/fix_kwargs_warning_for_activejob"
This reverts commit 80e72c5eb7d4f79cc8eaa63237e5a60dff48f4f4, reversing
changes made to 0dad1e3e770273631e5ab454d2d3003d90060e17.
2020-01-21 05:26:44 +09:00
Ryuta Kamizono
c10b580909 Fix keyword arguments warnings in Action Mailer 2020-01-19 14:29:32 +09:00
Abhay Nikam
d8beb77252 Bump license years from 2019 to 2020 [ci skip] 2020-01-01 15:10:31 +05:30
Haroon Ahmed
db1ae8cbb4 remove reference to global rails command and replace with bin/rails 2019-12-27 19:32:37 +00:00
bogdanvlviv
37b72ff5de
Fix ActionMailer assertions don't work for parameterized mail with legacy delivery job
We should backport this to `6-0-stable`.

Fixes https://github.com/rails/rails/issues/37605
2019-10-30 22:22:00 +00:00
Akira Matsuda
352560308b Fix keyword arguments warnings 2019-09-09 22:49:09 +09:00
Sunny Ripert
3a8dbe1746 Escape email addresses with name 2019-08-26 17:21:06 +02:00
Ryuta Kamizono
79740de065
Merge pull request #36198 from oneiros/actionmailer_ssl_option
Documentation for ActionMailer's SMTP over SSL/TLS option

[ci skip]
2019-07-29 23:30:35 +09:00
David Roetzel
1480b87f31 Improve documentation of :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]
2019-07-29 15:42:32 +02:00
Rafael França
abaa73f34a
Merge pull request #36227 from betesh/avoid-misleading-error-about-late-attachments
Prevent reading inline attachments after `mail` was called from raising an inaccurate exception
2019-07-26 16:00:44 -04:00
Ryuta Kamizono
c81af6ae72 Enable Layout/EmptyLinesAroundAccessModifier cop
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.
2019-06-13 12:00:45 +09:00
Isaac Betesh
efeddb08da Prevent reading inline attachments after mail was called from raising an 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.
2019-05-21 13:11:19 -07:00
Rafael Mendonça França
9834be6565
Start Rails 6.1 development 2019-04-24 15:57:14 -04:00
eileencodes
a2bd669ed2 v6.0.0.beta3 release
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEEvJkGf0BARV+D0L2ulxXUSC76N8FAlyJN4cACgkQulxXUSC7
 6N9ZXAf/Wx7edIct8kZzcC6irlROx4DzpNbrrH792sO1OAcnoFDE7DPkokllTEP/
 4kzC42lca/XG27MCl7E0dtVD8hIyAl89nxid6cwKFVZVTPIRVc1wjXkoiWy/cvd7
 6+9IjxhlgrzxGnw3aWZJG7H3iqz69yr55aoSDU/TbMqq5kQrqNF95vr2nc8LEUco
 SLQj0pO/tfJdHquSeX0JiXn3VSEHT+5TdLGQ3J/w0wFU6mkecH4MJMJvMwLFx/v4
 llnvF6HyfSLASWbrpdD3h6MQHpImDoee5vILXAHzPdSaEVcVa1cDFtMcPMYiu8Dw
 AGdCAaHQhZFFGoYK472+o6pur0dxEA==
 =5dET
 -----END PGP SIGNATURE-----

Merge tag 'v6.0.0.beta3'

v6.0.0.beta3 release
2019-03-13 13:11:10 -04:00
eileencodes
7c87fd5635 Prep release
* Update RAILS_VERSION
* Bundle
* rake update_versions
* rake changelog:header
2019-03-11 11:58:15 -04:00
Kasper Timm Hansen
c87f6841b7
Merge pull request #35121 from utilum/warning_tried_to_create_proc_without_block
Ruby 2.7 warning: creating a Proc without a block
2019-03-10 16:31:15 +01:00
John Hawthorn
4e6c8045c3 Add test and change how format set in ActionMailer
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.
2019-03-01 14:07:59 -08:00
John Hawthorn
c214546217 Create templates with format=nil 2019-02-26 16:59:04 -08:00
Rafael Mendonça França
5e6e505083
Preparing for 6.0.0.beta2 release 2019-02-25 17:45:04 -05:00
Aaron Patterson
ca5e23ed4d
Templates have one format
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.
2019-02-25 13:18:44 -08:00
Rafael Mendonça França
5330a34285
Fix class name in the documentation [ci skip] 2019-02-25 14:40:44 -05:00
Jaap van der Plas
2488901da8 Don’t log recipients when sending mail
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.
2019-02-13 09:55:38 -05:00
utilum
87a5379b42 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
2019-02-13 02:11:21 +01:00
Xavier Noria
821d6c694c Zeitwerk integration 2019-02-12 02:28:04 -08:00
Matthew Somerville
c95e98090b Correctly wrap inline attachments.
This switches the behaviour from:

multipart/related
  multipart/alternative
    text/plain
    text/html
  attachment (disposition: inline, image1)
  attachment (disposition: attachment, file1)
  attachment (disposition: attachment, file2)

to:

multipart/mixed
  multipart/related
    multipart/alternative
      text/plain
      text/html
    attachment (disposition: inline, image1)
  attachment (disposition: attachment, file1)
  attachment (disposition: attachment, file2)

Fixes #2686.

Thanks to clemens and eGust for reviewing.
2019-01-22 09:50:10 +00:00
Rafael Mendonça França
5a0230c67f
Preparing for 6.0.0.beta1 release 2019-01-18 15:42:12 -05:00
Gannon McGibbon
5d6578d15b Fix legacy fallback for parameterized mailers 2019-01-07 17:38:28 -05:00