Commit Graph

1538 Commits

Author SHA1 Message Date
Sen-Zhang
0b3ae023d2 generate application_mailer.rb if it is missing 2016-03-11 16:47:08 -08:00
Gadzhi Gadzhiev
37606d016d Remove redundant regexp escapes in generators 2016-03-08 15:30:12 +03:00
yui-knk
9a642931fb Prevent not-intended loading of ActionDispatch::IntegrationTest
After 9d378747326d26cf1afdac4433ead22967af0984 `ActionDispatch::IntegrationTest`
class is loaded and defined in all Rails environments, not only test but also
production. This is not-intended loading of a class which is only used in
test environment.
To prevent not-intended loading, add `ActiveSupport.run_load_hooks` to
`ActionDispatch::IntegrationTest` with `action_dispatch_integration_test` name
and use it in `ActionMailer`.
2016-03-07 16:48:18 +09:00
Sarah A
b6c9d4d76f Update base.rb 2016-03-03 23:54:41 -08:00
Santosh Wadghule
136f17458b Change 'a HTML' to 'an HTML' [ci skip] 2016-03-03 19:33:00 +05:30
Arthur Neves
2abcdfd978 Remove load_paths file 2016-02-27 13:03:57 -05:00
eileencodes
dbfa8fdfc2 Preparing for 5.0.0.beta3 release
Adds changelog headers for beta3 release
2016-02-24 11:14:40 -05:00
eileencodes
826420b5fc Prep release for Rails 5 beta3 2016-02-24 10:27:02 -05:00
Rafael Mendonça França
40be61dfda Add changelog entry for #22825 2016-02-24 00:13:50 -03:00
Rafael Mendonça França
338750393d Move private methods to the private visibility 2016-02-24 00:08:01 -03:00
Rafael Mendonça França
40fa818580 Move Caching module to Abstract Controller
Abstract Controller is the common component between Action Mailer and
Action Controller so if we need to share the caching component it need
to be there.
2016-02-23 21:11:15 -03:00
Stan Lo
3d7b0d4804 Change ActionMailer's default caching configuration and update generator's environment templates 2016-02-23 21:11:15 -03:00
Stan Lo
98fe07a946 Move ActionMailer::Caching's content into ActionMailer::Base instead of including it
Remove useless helper in ActionDispatch::Caching and fix indentation
2016-02-23 21:06:41 -03:00
Stan Lo
1de6f7938d Make caching configuration more flexible 2016-02-23 21:06:40 -03:00
Stan Lo
3e824d3f5b Move most caching methods to ActionDispatch::Caching, and let ActionMailer and ActionController to include it 2016-02-23 21:06:40 -03:00
Stan Lo
a24d067343 Move caching/fragments in ActionMailer and ActionController to action_dispatch/caching/fragments 2016-02-23 21:04:21 -03:00
Stan Lo
049b6e670f Porting ActionController::Caching to ActionMailer::Caching 2016-02-23 21:04:16 -03:00
Dave Gynn
42e9eed9ba Prevent ActionMailer initializer from triggering load of ActionMailer
the after_initialize block has been changed to use the configuration from
`config.action_mailer` rather than `ActionMailer::Base` so that action mailer
is not loaded before it is necessary.
the mailer preview routes setup have been moved out of an `on_load(:action_mailer)`
block.
2016-02-22 19:26:02 -08:00
Jon Moss
cd8bb8b6ce Add internal attribute to routes
This is meant to provide a way for Action Cable, Sprockets, and possibly
other Rack applications to mark themselves as internal, and to exclude
themselves from the routing inspector, and thus `rails routes` / `rake
routes`.

I think this is the only way to have mounted Rack apps be marked as
internal, within AD/Journey. Another option would be to create an array
of regexes for internal apps, and then to iterate over that everytime a
request comes through. Also, I only had the first `add_route` method set
`internal`'s default to false, to avoid littering it all over the
codebase.
2016-02-22 20:30:18 -05:00
Yves Senn
f41b90fee3 fix class name typo. 2016-02-16 11:57:06 +01:00
Yves Senn
9d37874732 reset ActionMailer::Base.deliveries in ActionDispatch::IntegrationTest.
Whenever you are sending emails in integration tests using the `:test`
delivery method you need to make sure that
`ActionMailer::Base.deliveries` is reset after every test. This piece of
boilerplate code is present in all my applications that send
emails. Let's have `ActionDispatch::IntegrationTest` reset the
deliveries automatically.
2016-02-16 11:20:59 +01:00
Mehmet Emin İNAÇ
2b63f2ee75 Change x-gzip to gzip in docs [ci skip]
For more information about GNU zip mime type please check IETF's web site [RFC6713](http://tools.ietf.org/html/rfc6713) or [IANA](http://www.iana.org/assignments/media-types/media-types.xhtml#application)
2016-02-13 17:11:05 +02:00
yuuji.yaginuma
ea785e535e Revert "When generating a mailer, you must specify Mailer in the class name in"
This reverts commit 8417d967e016f0219cc4ec30bf0d3908ce6cd29b.

In 5697bdbb6da5d08e541a3b12251cec90269b059b and af3eb5961e55a46b011be797e71f615f20f56686,
add mailer suffix to generated files and classes.
Therefore, no longer need to specify `Mailer` to class name. [ci skip]
2016-02-06 15:02:02 +09:00
Andrew Kaspick
8417d967e0 When generating a mailer, you must specify Mailer in the class name in
order to generate the proper files. Some of the docs/comments are
missing this important detail.
2016-02-05 13:59:17 -05:00
Sean Griffin
49f6ce63f3 Preparing for Rails 5.0.0.beta2 2016-02-01 14:37:52 -07:00
Matthew Draper
d6f2000a67 Wrangle the asset build into something that sounds more general 2016-02-01 05:03:03 +10:30
Aaron Patterson
6dfab475ca Merge branch '5-0-beta-sec'
* 5-0-beta-sec:
  bumping version
  fix version update task to deal with .beta1.1
  Eliminate instance level writers for class accessors
  allow :file to be outside rails root, but anything else must be inside the rails view directory
  Don't short-circuit reject_if proc
  stop caching mime types globally
  use secure string comparisons for basic auth username / password
2016-01-25 11:25:11 -08:00
Aaron Patterson
908c011395 bumping version 2016-01-25 10:22:15 -08:00
Rafael Mendonça França
9e6969412b Revert "Merge pull request #23218 from karlfreeman/bump_mail"
This reverts commit 62aa850fee2070ec3e2d9e4f925dfd7790d27b5e, reversing
changes made to 8c1f248c58ba65a786ae295def325c8982e7f431.

There is no reason to disallow mail 2.5 so we don't need to bump the
version constraint since people are still able to use mail 2.6 and get
all the memory saving that was pointed in the pull request description.
2016-01-24 12:34:05 -05:00
Karl Freeman
cef8b543b5 Bump mail gem constraint from [~> 2.5, >= 2.5.4] to ~> 2.6
Mails downstream dependency (Mime-types) has been shown to decrease
memory usage significantly in its 3.0 release. This memory decrease
will be a big win for users upgrading to Rails 5.

Lets nudge users to upgrade Mail alongside Rails.
2016-01-24 14:13:36 +00:00
Guillermo Iguaran
012f42a8b9 Update copyright notice for 2016 2016-01-01 12:31:53 -05:00
Rashmi Yadav
1b608a695c Update copyright notices to 2016 [ci skip] 2015-12-31 18:27:19 +02:00
yui-knk
8be6a3db7b Remove not used test fixture
'actionmailer/test/mailers/async_mailer.rb' was deleted by
f9da785d0b1b22317cfca25c15fb555e9016accb .
This template is not used now.
2015-12-30 15:33:26 +09:00
Yves Senn
c8ca57df5b release notes, extract notable changes from Action Mailer CHANGELOG.
[ci skip]
2015-12-22 13:35:34 +01:00
Genadi Samokovarov
c5b6ec7b0f No more no changes entries in the CHANGELOGs
During the `5.0.0.beta1` release, the CHANGELOGs got an entry like the
following:

```
* No changes.
```

It is kinda confusing as there are indeed changes after it. Not a
biggie, just a small pass over the CHANGELOGs.

[ci skip]
2015-12-21 11:46:38 +02:00
eileencodes
099ddfdefd Add CHANGELOG headers for Rails 5.0.0.beta1 2015-12-18 15:58:25 -05:00
eileencodes
7eae0bb88e Change alpha to beta1 to prep for release of Rails 5
🎉 🍻
2015-12-18 12:14:09 -05:00
David Heinemeier Hansson
83e3a17d32 Same gemspec formats everywhere 2015-12-18 13:20:49 +01:00
David Heinemeier Hansson
293d35e256 ApplicationMailer should be generated by default just like every other Application* parent 2015-12-17 17:35:20 -02:00
Akshay Vishnoi
ccb6b2e87f [ci skip] Fix grammar and sentence framing 2015-12-17 12:23:33 +05:30
Elektron1c97
6bd417df50 [ci skip] Add a dollar sign to each command in the READMEs
According to pr #22443 in the guides there's always a dollar sign before every command, so why is in the main README a `$` and in every submodule a `%`?

Just eye candy..
2015-12-06 19:18:52 +01:00
Ryan Buckley
50593cc205 Make ActionMailer::Base.respond_to_missing? private 2015-12-03 10:34:39 -10:00
Ryan Buckley
e899dfac47 Replace ActionMailer::Base#respond_to? with respond_to_missing? 2015-12-02 22:36:36 -10:00
Rafael Mendonça França
7b122d3988 Move all nodoc methods to the private section
Since they are nodoc there is no need to be protected.
2015-11-24 00:52:22 -02:00
Rafael Mendonça França
53d316c269 Put all private method together 2015-11-24 00:45:52 -02:00
Rafael Mendonça França
782edbd28f Avoid mutating the headers hash
We are already filtering the keys in the assign_headers_to_message
method so we can just update the filter.
2015-11-24 00:43:25 -02:00
Rafael Mendonça França
c6368db90f nodoc in the private method 2015-11-24 00:43:14 -02:00
Rafael Mendonça França
63ea79e586 Merge pull request #22120 from hnatt/refactor-actionmailer
Refactor ActionMailer::Base
2015-11-24 00:38:30 -02:00
Sean Griffin
3faf748562 Revert "Merge pull request #18446 from cloud8421/actionmailer-unregister-interceptor"
This reverts commit 65a61ab7c370d2894c11ce276725f723a5c9c111, reversing
changes made to 14314ca18302f18c3d8bb7a63e9f71ac4c2290c2.

This PR broke the build
2015-11-23 15:01:24 -07:00
Sean Griffin
65a61ab7c3 Merge pull request #18446 from cloud8421/actionmailer-unregister-interceptor
ActionMailer::Base can unregister interceptor(s).
2015-11-23 14:29:56 -07:00
Kasper Timm Hansen
f21743b5bc Merge pull request #22077 from obduk/clean-up-logs
Remove newlines from start of logs
2015-11-19 12:23:25 +01:00
Yves Senn
a80fb6f9b3 tests, define Rails.root before loading Action Mailer.
Since `bin/test` would define `Rails.root` before loading AM but `bundle
exec rake` would define it after loading AM, this lead to the following
test failure when using `bin/test`:

```
--- expected
+++ actual
@@ -1 +1 @@
-{:location=>"/var/folders/_r/9kh50y4j0vn7zgg2p65z1lcm0000gn/T/mails"}
+{:location=>"/Users/senny/Projects/rails/actionmailer/tmp/mails"}
```

This patch ensures that `Rails.root` is defined when loading AM to
achieve consistent test results.
2015-11-04 16:35:31 -05:00
Vijay Dev
b217354dbb Merge branch 'master' of github.com:rails/docrails 2015-10-31 17:01:41 +00:00
Aaron Patterson
e76c38ef10 split process from mailer instantiation
this allows us to construct mailer objects without possibly disastrous
side-effects.
2015-10-30 14:53:19 -07:00
hnatt
1be276beb4 Rename ActionMailer::Base#class_from_value -> observer_class_for 2015-10-30 10:45:35 +02:00
hnatt
baaf3769ff Don't mutate headers in ActionMailer::Base#collect_responses_from_templates 2015-10-30 10:41:58 +02:00
hnatt
2a55a6d2e5 Pass message as argument to ActionMailer::Base#assign_headers_to_message 2015-10-30 08:56:00 +02:00
hnatt
c26abb8691 Fix indentation in ActionMailer::Base#collect_responses_from_templates 2015-10-29 22:01:16 +02:00
hnatt
4b65e5058e Refactor out headers to message assignment from ActionMailer::Base#mail 2015-10-29 21:58:27 +02:00
hnatt
79b6a4bbc4 Use attr_internal in ActionMailer::Base#mail instead of local var for message 2015-10-29 21:55:14 +02:00
hnatt
04f1ce7950 Refactor out defaults handling from ActionMailer::Base#mail 2015-10-29 21:52:04 +02:00
hnatt
8c566b9a94 Refactor ActionMailer::Base#collect_responses 2015-10-29 21:28:22 +02:00
hnatt
e71cfc109d Reduce code duplication in ActionMailer::Base#register_observer and #register_interceptor 2015-10-29 21:20:08 +02:00
Owen Davies
5e4f82a5f3 Remove newlines from start of logs
Currently if using a single line logger, this causes the time stamp and
log message to be on separate lines which is not common to how most
other logging works.
2015-10-26 14:58:18 +00:00
yui-knk
1099329be0 Delete needless require 'active_support/deprecation'
When `require 'active_support/rails'`, 'active_support/deprecation'
is automatically loaded.
2015-10-20 20:02:59 +09:00
Arthur Nogueira Neves
9674703671 Merge pull request #17388 from akampjes/master
ActionMailer https on URL with force_ssl = true
2015-10-12 14:26:11 -04:00
Ronak Jangir
495722a956 Fixed wording in Assertion docs, changed ‘Assert’ -> ‘Asserts’ 2015-10-07 21:07:46 +05:30
Sean Griffin
411ed20865 Merge pull request #21865 from Gaurav2728/test_cases_protected_method_nodoc
action mailer test cases protected method can be `# :nodoc:` [ci skip]
2015-10-04 17:23:47 -06:00
Vijay Dev
7976b6d306 Merge branch 'master' of github.com:rails/docrails 2015-10-04 12:33:14 +00:00
Gaurav Sharma
64e316edd3 action mailer test cases protected method can be # :nodoc: 2015-10-04 13:30:00 +05:30
amitkumarsuroliya
367e8cf763 Add missing punctuation mark to all ActionMailer docs [ci skip] 2015-09-28 21:17:44 +05:30
amitkumarsuroliya
6474c53dcb Add a missing period to ActionMailer Base docs [ci skip] 2015-09-28 18:15:15 +05:30
Ronak Jangir
ecc9473622 Added assertion for error messages for nil and unknown delivery methods
As `deliver_now` `RuntimeError` for both nil & unknown delivery method so it’s good to have assertion for error messages
2015-09-22 19:11:03 +05:30
yuuji.yaginuma
09e3aa62dc change test method name to the appropriate name 2015-09-19 17:33:14 +09:00
Ronak Jangir
fef6c11d2a Added test for any if called without specifying any format
Example
````ruby
mail(hash) do |format|
  format.any
end
````
2015-09-18 22:56:42 +05:30
Isaac Betesh
efadc69daa When used by ActionMailer, ActionView should automatically use the correct MIME type just as it does when used by ActionDispatch #11157 2015-09-09 08:44:37 -04:00
Ronak Jangir
8d7bf97798 Removed duplicate requiring minitest/mock as it is already required in method_call_assertions 2015-08-26 19:43:54 +05:30
Ronak Jangir
c48257b0af Removed mocha from ActionMailer 2015-08-20 11:27:49 +05:30
Andrew Kampjes
f0a3af209f ActionMailer https on URL with force_ssl = true
`config.force_ssl = true` will set
config.action_mailer.default_url_options = { protocol: 'https' }

If you have turned on force_ssl, and then gone to the effort of setting
config.action_mailer.default_url_options = {host: 'example.com'} then
you are probably pointing people back to your current app and want
https on that too.
2015-08-14 08:05:11 +12:00
mlbileschi
738be4457b fix comment about which mail headers are excluded 2015-08-11 16:30:47 -04:00
yui-knk
6149444685 Make silence a warning inserted by commit #4b3f8ac 2015-07-30 00:42:19 +09:00
Kasper Timm Hansen
062cbd18dd Revert "Merge pull request #20758 from xijo/action_mailer_message_delivery_respects_i18n_locale"
This reverts commit f2a8c23654d69dd8f294971487b5abf0e5d891c3, reversing
changes made to 3046c9bbe154aa717a5147091be8b495ed8969c4.
2015-07-07 22:11:20 +02:00
Johannes Opper
ca2387eb01 ActionMailer::MessageDelivery respects current I18n.locale
When #deliver_now is called all translations within the
generated email will be looked up for the current I18n
locale.

    I18n.locale = ‘de’
    mail.deliver_now # Generates german email, correct

In #enqueue_delivery the locale was not considered and
the resulting job uses the default locale.

    I18n.locale = ‘de’
    mail.deliver_later # Generate english email, incorrect

In order to achieve a consistent behaviour the current locale
is now always passed to `ActionMailer::DeliveryJob`.
2015-07-05 20:21:25 +02:00
Yves Senn
9946788775 select the AR adapter through bin/test. 2015-06-11 14:24:56 +02:00
Yves Senn
54d84cbb77 use our runner (bin/test) for framework components.
This adds a script `bin/test` to most Rails framework components. The
script uses the rails minitest plugin to augment the runner.
See https://github.com/rails/rails/pull/19571 for details about the
plugin.

I did not yet add `bin/test` for activerecord, activejob and railties.
These components rely on specific setup performed in the rake-tasks.
2015-06-11 14:12:15 +02:00
Robin Dupret
0b57f090c9 Tiny documentation edits [ci skip] 2015-06-09 11:49:33 +02:00
Rafael Mendonça França
ae5f2b4e79 Document config.action_mailer.deliver_later_queue_name
Also add a CHANGELOG entry for #18587

[ci skip]
2015-06-03 13:28:21 -03:00
Rafael Mendonça França
cecbf9ed32 Merge pull request #18587 from chrismcg/allow_deliver_later_queue_name_to_be_configured
Allow configuration of ActionMailer queue name
2015-06-03 13:25:32 -03:00
Chris McGrath
f5a131aaea Allow configuration of ActionMailer queue name 2015-06-02 10:49:49 +01:00
Rafael Mendonça França
b42d770b3b Make the wording less confusing
This partially reverts commit ac02df5c7827630a91acd9a6b916db9eda1f38b4.

[ci skip]
2015-05-29 15:24:13 -03:00
Manish Puri
9575f4fdca minor text change 2015-05-29 13:50:12 -04:00
Manish Puri
ac02df5c78 Update inline_preview_interceptor.rb 2015-05-29 13:44:46 -04:00
Gaurav Sharma
baa773a520 not require mail file
```
  it added in this commit (2a25c4ce6d), now no warnings occur.
  ```
2015-05-29 21:25:28 +05:30
Arun Agrawal
21b6b68f63 Remove unused package tasks
We are using `all:build` now.
2015-05-28 09:06:10 +02:00
Arun Agrawal
4194d052d8 Remove broken and unused release task
- We do release with release.rb
- There is no `rake/gemcutter`
2015-05-22 14:30:30 +02:00
Gourav Tiwari
4547d87853 formatting changes [ci skip] 2015-05-17 10:41:27 -07:00
claudiob
0080a886b2 [ci skip] Don’t encourage sudo gem install
I think we are better off leaving `sudo` outside of the documented
way of installing gems (`activerecord`, `actionpack`, …).

We don’t want newbies to think that `sudo` is required or, even worse, than
they actually have to type `[sudo] gem install`.

In most scenarios, `sudo` is not needed to install gems, and people who do
need it, probably already know about it.

What do you think? 😁
2015-05-12 14:51:19 -07:00
Ankit Gupta
0e6a67644a not needed require's
- as core_ext is not used and test pass locally
- mail is already required in abstract_unit
2015-05-10 08:42:30 -04:00
yuuji.yaginuma
49a59cc6a5 assert_emails in block form use the given number as expected value 2015-05-09 18:59:59 +09:00
Andrew White
faaed863dd Document inline image mailer preview interceptor
Explain what the interceptor is used for and how to remove it.
2015-05-04 19:46:51 +01:00
Andrew White
60239f3e5a Add support for inline images to mailer previews
Use a preview interceptor to search for inline cid: urls in src
attributes and convert them to data urls.
2015-05-04 10:56:59 +01:00
Remo Mueller
f5132c19d5 Mailer preview now uses url_for to fix links to emails for apps running on a subdirectory, closes #19092. 2015-04-30 10:12:00 -04:00
Javan Makhmali
20f6f646d1 Make ActionMailer #cache helper a no-op, not an exception 2015-04-28 13:56:42 -06:00
Yves Senn
767d60156b mailer previews for NullMail instances. Closes #19849. 2015-04-28 16:00:08 +02:00
Yves Senn
d704f8f808 mailer previews, make sure labels and values line up.
While this was true before when every `dd` had a value,
this patch makes sure that everything keeps lining up even
when the `dd` node is blank.
2015-04-28 16:00:07 +02:00
Achilleas Pipinellis
e7d2cef1f4 AUTH PLAIN is Base64 encoded [ci skip]
Contrary to what the name suggests, PLAIN SMTP authentication is not
sent in plain text but is Base64 encoded like the LOGIN method. Their
difference is described in the third link below.

* https://tools.ietf.org/html/rfc4954
* https://en.wikipedia.org/wiki/SMTP_Authentication
* http://www.samlogic.net/articles/smtp-commands-reference-auth.htm
2015-04-28 11:49:13 +03:00
Guillermo Iguaran
33ea933d7b Merge pull request #19753 from jonatack/use-ruby-2-2-2
Upgrade to Ruby 2.2.2
2015-04-13 22:56:47 -05:00
Jon Atack
32f7491808 Upgrade to Ruby 2.2.2
and fix the grammar in the ruby_version_check.rb user message.
2015-04-14 08:41:56 +05:30
Zachary Scott
a647277fb9 Since the delegator wasn't identified earlier, we should here [ci skip] 2015-04-12 13:29:58 -07:00
Zachary Scott
1ffd603712 Merge branch 'action-mailer-async-doc-fixes' of https://github.com/mfazekas/rails into mfazekas-action-mailer-async-doc-fixes
Conflicts:
	actionmailer/lib/action_mailer/base.rb
2015-04-12 13:28:10 -07:00
Anton Davydov
91744696a4 [skip ci] Fix typo in actionmailer documentation 2015-03-15 23:32:24 +03:00
Peter Suschlik
f0768eba28 Target Ruby 2.2.1 in gemspecs
This is a follow-up to #19257
2015-03-09 09:56:26 +01:00
Matthew Draper
b5eb0b6cc3 Revert "Leave all our tests as order_dependent! for now"
This reverts commit 2f52f969885b2834198de0045748436a4651a94e.

Conflicts:
	actionmailer/test/abstract_unit.rb
	actionview/test/abstract_unit.rb
	activemodel/test/cases/helper.rb
	activerecord/test/cases/helper.rb
	activesupport/test/abstract_unit.rb
	railties/test/abstract_unit.rb
2015-03-06 04:38:54 +10:30
Robin Dupret
9f4210cd80 Merge pull request #19133 from davydovanton/update-doc-example-mail-block-format
[ci skip] Add code example for MailHelper#block_format documentation
2015-03-02 13:10:30 +01:00
Anton Davydov
435aa7e34f [ci skip] Add code example for MailHelper#block_format documentation 2015-03-02 15:01:57 +03:00
Thiago Pradi
bc970e8335 Removing unused mailer templates 2015-03-01 16:07:24 -03:00
yuuji.yaginuma
5ef18712c5 update docs to reflect that mailer generator add suffix to generated classes [ci skip] 2015-02-25 19:22:33 +09:00
Rafael Mendonça França
39c936b760 Merge pull request #18393 from y-yagi/fix_mailer
follow up to #18074
2015-02-18 19:05:07 -02:00
Anton Davydov
44a49e5534 Added default values for #format_paragraph docs [skip ci] 2015-02-15 20:29:58 +03:00
Aditya Kapoor
7b58423251 remove noise from AM tests 2015-02-07 13:38:18 +05:30
Vipul A M
6eced6a1fe Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 onwards. 2015-02-03 20:51:40 +05:30
robertomiranda
ce8efcf296 Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846
ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
2015-01-31 23:12:41 -05:00
Claudio Ortolina
ff5fcf65ec ActionMailer::Base can unregister interceptor(s).
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`.

Refactors logic to constantize a string/symbol into separate method.
2015-01-31 14:25:00 +00:00
Yves Senn
afe402dac7 unify CHANGELOG format. [ci skip] 2015-01-31 11:54:00 +01:00
Rafael Mendonça França
855cca0662 Merge pull request #18521 from andrewvida/master
Correct the views that the mail method sends in API docs.
2015-01-14 17:47:52 -02:00
Andrew Vida
29a2977af5 Correct views mail method sends in API docs 2015-01-14 14:43:58 -05:00
claudiob
e4613c97c3 Fix assertion that was never run
In order to run whether the `welcome` method of the ActionMailer::Base
subclass raises an error, `message` must be called, otherwise the method
is not executed at all.

You could just replace with `def welcome; raise StandardError; end` and you
would still see a passing test.

This commit fixes the test so the assertion is actually executed, just like
any other tests in the file, where `.message` is called.
2015-01-11 11:50:29 -08:00
Carlos Souza
6870d48d19 Add _mailer suffix to i18n path
For mailers created via generators

Follow up to #18074
2015-01-08 22:24:22 -05:00
George Claghorn
3f17fbd68d Add assert_enqueued_emails and assert_no_enqueued_emails 2015-01-08 09:41:22 -05:00
yuuji.yaginuma
af3eb5961e follow up to #18074
* ignore mailer suffix when generate test files
* add mailer suffix to view files
2015-01-08 22:21:54 +09:00
Carlos Antonio da Silva
f9e0ec5449 Move changelog entry to the top [ci skip] 2015-01-07 07:44:57 -02:00
Carlos Souza
5697bdbb6d Add mailer suffix to generated files and classes
Following the same naming convention used in
controllers and jobs.
2015-01-06 10:46:22 -05:00
Rafael Mendonça França
bf7b8c193f Remove unneeded requires
These requires were added only to change deprecation message
2015-01-04 12:11:03 -03:00
Rafael Mendonça França
d282125a18 Remove deprecate *_path helpers in email views 2015-01-04 11:58:42 -03:00
claudiob
755dcd0691 Remove deprecated ActionMailer deliver & deliver!
These methods were deprecated in Rails 4.2 (see f4ee1147) so they can
be safely removed in Rails 5.0.
2015-01-04 11:58:41 -03:00
Robin Dupret
24637e577c Merge pull request #18271 from arunagw/change-copyright-year
Update copyright notices to 2015 [ci skip]
2015-01-01 00:08:17 +01:00
Robin Dupret
ae08bef428 Changelog edits [ci skip] 2014-12-31 17:35:41 +01:00
Arun Agrawal
4de18d0ead Update copyright notices to 2015 [ci skip] 2014-12-31 08:34:14 +01:00
Rafael Mendonça França
ecb1981bfd Template lookup now respect default locale and I18n fallbacks.
Given the following templates:

    mailer/demo.html.erb
    mailer/demo.en.html.erb
    mailer/demo.pt.html.erb

Before this change for a locale that doesn't have its related file
the `mailer/demo.html.erb` will
be rendered even if `en` is the default locale.

Now `mailer/demo.en.html.erb` has precedence over the file without
 locale.

Also, it is possible to give a fallback.

    mailer/demo.pt.html.erb
    mailer/demo.pt-BR.html.erb

So if the locale is `pt-PT`, `mailer/demo.pt.html.erb` will be
 rendered given the right I18n fallback configuration.

Fixes #11884.
2014-12-29 23:48:35 -03:00
claudiob
d3b098b828 Require Ruby 2.2 for Rails 5.0
Stems from [this comment](https://github.com/rails/rails/pull/18203#issuecomment-68138096) by @robin850
and by the blog post http://weblog.rubyonrails.org/2014/12/19/Rails-4-2-final
2014-12-26 13:53:09 +01:00
Yves Senn
ced687fe71 Merge pull request #18163 from y-yagi/fix_nodoc_typo
fix typo in nodoc [ci skip]
2014-12-23 08:42:51 +01:00
yuuji.yaginuma
2a110fcfc8 fix typo in nodoc 2014-12-23 16:03:17 +09:00
Miklos Fazkeas
660e1abd63 Fixes to inaccurate documentation in action_mailer [ci skip] 2014-12-18 11:36:02 +01:00
Rafael Mendonça França
c8284c8025 Merge pull request #17896 from GBH/globbing_route_mailer_preview
fixing mailer previews for apps with globbing route
2014-12-08 15:10:47 -02:00
Rafael Mendonça França
da13b9aedc Merge pull request #17797 from y-yagi/donot_delete_mailer_layouts
Don't remove mailer layouts files
2014-12-04 18:29:50 -02:00
Oleg
ccc3ddb776 fixing mailer previews for apps with globbing route 2014-12-03 10:43:12 -05:00
Sven Pachnit
e1408971b8 Fix documentation for #default
Just a little syntax error I spotted by accident. Cannot pass hash with curly braces without normal parentheses.
2014-12-01 19:26:50 +01:00
yuuji.yaginuma
c15d3fb0da [ci skip] fix description of url_for 2014-11-30 10:18:07 +09:00
Erik Michaels-Ober
d1374f99bf Pass symbol as an argument instead of a block 2014-11-29 11:53:24 +01:00
claudiob
96d0f751f9 Bump required Ruby version to 2.1.0
[This article](http://weblog.rubyonrails.org/2014/8/20/Rails-4-2-beta1/#maintenance-consequences-and-rails-5-0) states that:

> Rails 5.0 is in most likelihood going to target Ruby 2.2.

Before the exact minimum version is fully decided, @arthurnn [suggests](https://github.com/rails/rails/pull/17830#issuecomment-64940383)
that **at least** version 2.1.0 **must** be required by the `gemspec` files.
2014-11-28 22:59:51 -08:00
Rafael Mendonça França
f25ad07f5a Start Rails 5 development 🎉
We will support only Ruby >= 2.1.

But right now we don't accept pull requests with syntax changes to drop
support to Ruby 1.9.
2014-11-28 15:00:06 -02:00
Jon Atack
d21d8f903d Follow-up to e2cce6c
[skip ci]
2014-11-27 17:46:56 +01:00
Zachary Scott
e2a01aef42 Fix CHANGELOG typo introduced in e2cce6cd [ci skip] 2014-11-27 08:43:37 -08:00
Jon Atack
e2cce6cd41 Action Mailer change log pass
[skip ci]
2014-11-27 17:36:15 +01:00
yuuji.yaginuma
f9411b464d Don't remove mailer layouts files 2014-11-27 14:36:10 +09:00
Rafael Mendonça França
e3f7817cec Use released rails-dom-testing 2014-11-25 19:43:36 -02:00
Xavier Noria
79eedb346e let the AM test suite pass in 1.9 2014-11-24 22:03:54 -08:00
Guo Xiang Tan
ec49324bd7 Update docs to reflect changes to MailerGenerator. 2014-11-25 09:56:49 +08:00
Guo Xiang Tan
cd902a0d1d Add missing CHANGELOG entry. 2014-11-25 09:28:16 +08:00
David Heinemeier Hansson
35362fc226 Merge pull request #17646 from andyjeffries/html_layout_fix
Creating mailer layouts by default, including html and body tags
2014-11-25 01:59:43 +03:00
Xavier Noria
9685080a76 let mailer templates generate URLs by default [Xavier Noria, Richard Schneeman] 2014-11-24 14:33:50 -08:00
Andy Jeffries
a58da25d90 Removing unnecessary File.join calls 2014-11-24 09:37:49 +00:00
Andy Jeffries
38cfaa8285 Creates an ApplicationMailer and layout by default, including html and body tags to reduce spam score 2014-11-21 16:46:49 +00:00
Robin Dupret
1d6d0cc245 Tiny documentation styling fixes [ci skip] 2014-11-02 12:32:50 +01:00
Vipul A M
d3e410070d - Changed redundant user of deliver to deliver_now
- Wrapped text in setting defaults section. Also added break, to a sentence.
[ci skip]
2014-11-01 01:08:31 +05:30
Godfrey Chan
4daebedcc4 Prepare for 4.2.0.beta4 release 2014-10-30 14:12:24 -07:00
Xavier Noria
e595d91ac2 edit pass over all warnings
This patch uniformizes warning messages. I used the most common style
already present in the code base:

* Capitalize the first word.

* End the message with a full stop.

* "Rails 5" instead of "Rails 5.0".

* Backticks for method names and inline code.

Also, converted a few long strings into the new heredoc convention.
2014-10-28 17:47:32 -07:00
Xavier Noria
b3bfa361c5 let's warn with heredocs
The current style for warning messages without newlines uses
concatenation of string literals with manual trailing spaces
where needed.

Heredocs have better readability, and with `squish` we can still
produce a single line.

This is a similar use case to the one that motivated defining
`strip_heredoc`, heredocs are super clean.
2014-10-28 16:35:24 -07:00
Rishi Jain
747a1c9b28 Making the actionmailer docs more explicit to understand [ci skip] 2014-10-26 10:09:22 -07:00
yuuji.yaginuma
7bb678bb7c [ci skip] add :queue option to deliver_later and deliver_later! documentation 2014-10-19 09:35:00 +09:00
Zachary Scott
e994fa11cf [ci skip] Fix word wrap, capitalization, and spacing of text from #17284 2014-10-18 13:14:00 -07:00
Nicolas Cavigneaux
642794a3f2 [ci skip] Add a note about headers overwriting
Since some headers can appear multiple times in an email it's required
to set it to nil first when you want to overwrite an existing one.

This commit add some information about this process.

Fix #15912
2014-10-18 13:01:20 -07:00
Rafael Mendonça França
be5521eb4e Use released rails-dom-testing 2014-10-16 16:53:46 -03:00
Yves Senn
400b0818fa some changelog formatting. [ci skip] 2014-10-16 09:11:41 +02:00
Rafael Mendonça França
0bd1a4e05c Only include the needed assertions 2014-10-07 20:01:40 -03:00
schneems
e6b0b760cc fix tests on action_mailer
Include appropriate helpers and use `assert_dom_equal` where applicable
2014-10-07 17:40:59 -05:00
Robin Dupret
1fac7b79f3 Follow up to #16613
Since we want this flag to be enabled anytime we are running the tests
under JRuby, let's enable this at the Rakefile level so people get the
performance boost on their local checkout.

Moreover, we avoid having to update this particular line anytime the
option changes on the JRuby side.

The only drawback is that we have to define it in every Rakefile but
there's no big deal, this is already the case for other options.
2014-09-28 12:04:06 +02:00
Rafael Mendonça França
4581d04477 Preparing for 4.2.0.beta2 release 2014-09-26 17:19:53 -03:00
Rafael Mendonça França
2c0cad8034 Use released rails-dom-testing 2014-09-25 12:31:42 -03:00
Yves Senn
7aca4a721e Merge pull request #16974 from silp-com/mail_was_called
ActionMailer: mark mail as called after instead of before processing it
2014-09-22 16:09:48 +02:00
Christian Felder (masone)
b37e8482ca Allow attaching files while the mail view is rendered 2014-09-22 15:52:48 +02:00
Akshay Vishnoi
8841f45129 [ci skip] ActionView and ActionMailer CHANGELOG docs fixes 2014-09-18 03:40:51 +05:30
Godfrey Chan
2b41343c34 Default to sorting user's test cases for now
Goals:

1. Default to :random for newly generated applications
2. Default to :sorted for existing applications with a warning
3. Only show the warning once
4. Only show the warning if the app actually uses AS::TestCase

Fixes #16769
2014-09-08 05:32:16 -07:00
Cristian Bica
15ddf60e05 Rename remaining :in / :at to :wait / :wait_until 2014-09-04 08:08:06 +03:00
Cristian Bica
1e237b4e44 Active Job refactoring 2014-09-03 23:01:46 +03:00
Matthew Draper
2f52f96988 Leave all our tests as order_dependent! for now
We're seeing too many failures to believe otherwise.

This reverts commits bc116a55ca3dd9f63a1f1ca7ade3623885adcc57,
cbde413df3839e06dd14e3c220e9800af91e83ab,
bf0a67931dd8e58f6f878b9510ae818ae1f29a3a, and
2440933fe2c27b27bcafcd9019717800db2641aa.
2014-09-02 23:55:34 +09:30
yuuji.yaginuma
83bf95faac [ci skip] Fix a typo in the doc of MessageDelivery 2014-09-02 17:57:23 +09:00
Abdelkader Boudih
377d0de843 [ActionMailer] Rename test/test_test to test/test_case_test 2014-08-30 14:38:33 +00:00
Robin Dupret
84c0f73c8d Refer to the library name instead of the constant
When we are loading a component and we want to know its version, we are
actually not speaking about the constant but the library itself.

[ci skip]

[Godfrey Chan & Xavier Noria]
2014-08-30 11:58:23 +02:00
David Heinemeier Hansson
7475b43cdb Merge branch 'master' of github.com:rails/rails 2014-08-29 14:54:08 -07:00
Robin Dupret
a548e2ba16 Make test:isolated run without bundler for Action Mailer
Action Mailer tests weren't able to run in isolation without the bundle
exec prefix since we were requiring gems before requiring abstract_unit.

We don't need the `gem` call thus and the require_relative since the
test directory should be present in the load path when we run any test.
2014-08-29 12:41:37 +02:00
Matthew Draper
b47d8dea25 Merge pull request #16598 from seuros/master
[ActionMailer] require activejob railtie
2014-08-23 03:45:47 +09:30
Abdelkader Boudih
39704bb89f [ActionMailer] require activejob railtie 2014-08-22 17:37:36 +00:00
Xavier Noria
b6ccaee952 applies API guidelines to new AM docs 2014-08-21 23:27:25 +02:00
Akira Matsuda
31abbe5154 Fix SyntaxError 2014-08-21 06:40:00 +09:00
Rafael Mendonça França
f7851c61d8 Make the explicit the Active Job dependency of Action Mailer 2014-08-20 16:51:17 -03:00
Abdelkader Boudih
6e75e7e3bc [Rdoc] Make clear that we are sending an AR object [ci skip] 2014-08-20 16:41:00 +00:00
Abdelkader Boudih
d1629346b9 Fix typo in rdoc [ci skip] 2014-08-20 16:22:41 +00:00
Cristian Bica
9e7f4a94ca Updated rdoc / guides / release notes related to ActiveJob / ActionMailer 2014-08-20 17:48:34 +03:00
Cristian Bica
f4ee114746 Deprecated .deliver / .deliver! to .deliver_now / .deliver_now! 2014-08-20 17:48:34 +03:00