Commit Graph

1047 Commits

Author SHA1 Message Date
Rafael França
f680664d4e Merge pull request #28244 from ixti/improve/action-mailer-preview-params
Pass request params to ActionMailer::Preview
2017-04-26 20:15:30 -07:00
Matthew Draper
6c08d480f1 Start Rails 5.2 development 2017-03-22 10:11:39 +10:30
Krzysztof Zych
3a6e84715e Document using default_url_options in an ActionMailer class. 2017-03-08 13:34:28 +01:00
Alexey Zapparov
8e6c6d854c
Pass request params to ActionMailer::Preview 2017-03-01 20:54:14 +01:00
Rafael Mendonça França
f4acdd83ff
Preparing for 5.1.0.beta1 release 2017-02-23 14:53:21 -05:00
Stan Lo
dde7134e07 Freeze fragment cache related instrument name.
ActionMailer::Base#instrument_name and
ActionController::Base#instrument_name will be frequently called once
caching is enabled. So it's better to freeze them instead of create new
string on every call.

Also, the instrument name in #instrument_fragment_cache will usually
be "write_fragment.action_controller" or
"read_fragment.action_controller". So freezing them might also gain some
performance improvement. We have done something like this in other places:
https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
2017-02-07 00:41:02 +08:00
yuuji.yaginuma
53b98f1dda Add :args to process.action_mailer event 2017-02-04 11:43:24 +09:00
Eugene Kenny
ebededb372
Don't mutate raw_source in mailer preview interceptor
The raw_source method is documented as returning the exact value that
was used to create the body; mutating it breaks that contract.

Additionally, if the value used to create the body is blank, raw_source
returns a frozen string which causes the interceptor to raise an error.
2017-01-30 22:20:47 -07:00
yuuji.yaginuma
18cc66cef6 add default value to deliver_later_queue_name option [ci skip] 2017-01-31 10:23:21 +09:00
Rafael Mendonça França
2dadf73891
Document with with an example an link to Parameterized
Also change the class_methods to ClassMethods since the former document
the method as an instance method of Parameterized not as a class method.
2017-01-30 13:38:12 -05:00
Rafael Mendonça França
d3cb00b87e
✂️ 2017-01-30 13:38:06 -05:00
Rafael Mendonça França
bfda627713
No need to advertise in the rdoc documentation 2017-01-30 13:31:11 -05:00
Rafael Mendonça França
735aa635c5
Implement respond_to_missing? in the Parameterized::Mailer class 2017-01-30 13:28:14 -05:00
Rafael Mendonça França
bfc69e873d
Remove unneeded nodoc 2017-01-30 13:17:52 -05:00
Rafael Mendonça França
58f9c4f096
Override the initializers instead of using tap
We own the class so we can override the initialize.
2017-01-30 13:02:30 -05:00
Rafael Mendonça França
04b59ec930
Make internal classes internal for the documentation 2017-01-30 13:02:11 -05:00
David Heinemeier Hansson
d5651436d6 Make assert_enqueued_emails + assert_no_enqueued_emails consider parameterized delivery jobs
Needed for testing of parameterized mailers
2017-01-30 13:41:08 +01:00
Kasper Timm Hansen
e552db0588 [ci skip] other -> order; expand ivar 2017-01-28 19:00:54 +01:00
David Heinemeier Hansson
1cec84ad2d Offer the option to use parameterization for shared processing of headers and ivars (#27825)
Offer the option to use parameterization for shared processing of headers and ivars
2017-01-28 11:20:46 +01:00
Akira Matsuda
aaece61a53 ZOMG worst typo in my life 😱 2017-01-15 05:16:53 +09:00
Akira Matsuda
ec513098fe respond_to_missing? should fallback to super where method_missing could call super 2017-01-15 03:58:19 +09:00
Akira Matsuda
b70fc698e1 Reduce string objects by using \ instead of + or << for concatenating strings
(I personally prefer writing one string in one line no matter how long it is, though)
2017-01-12 17:45:37 +09:00
Rafael Mendonça França
e482dce0ed
Merge pull request #27227 from MQuy/allow-custom-content-type-in-mail-body
Allow to custom content type when setting mailer body
2017-01-06 06:03:41 -05:00
MQuy
f091bd67b3 Remove unnecessary condition in content_type 2017-01-06 18:37:33 +08:00
Akira Matsuda
5473e390d3 self. is not needed when calling its own instance method
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
2017-01-05 19:58:52 +09:00
Rafael Mendonça França
b6ffb5efcb
Revert "Merge pull request #27550 from mtsmfm/fix-generator-command-for-nested-rails-engine"
This reverts commit 1e969bfb98b88799e2c759fce25a1d8cf00d7ce7, reversing
changes made to a5041f267ded119c2d00b8786c2f2c1e3f93c8a1.

Reason: It breaks the public API
2017-01-03 21:51:18 -05:00
Fumiaki MATSUSHIMA
085546df45 Fix generator command for nested (namespaced) rails engine
If we create nested (namespaced) rails engine such like bukkits-admin,
`bin/rails g scaffold User name:string age:integer`
will create
`bukkits-admin/app/controllers/bukkits/users_controller.rb`
but it should create
`bukkits-admin/app/controllers/bukkits/admin/users_controller.rb`.

In #6643, we changed `namespaced_path` as root path
because we supposed application_controller is always in root
but nested rails engine's application_controller will not.
2017-01-03 21:18:09 +09:00
Jon Moss
37d956f45f Bump license years for 2017
Per https://www.timeanddate.com/counters/firstnewyear.html, it's already
2017 in a lot of places, so we should bump the Rails license years to
2017.

[ci skip]
2016-12-31 08:34:08 -05:00
Akira Matsuda
8c7e82e8e0 Privatize unneededly protected methods in Action Mailer 2016-12-24 21:01:07 +09:00
Akira Matsuda
bbbc3e1619 No need to nodoc private method 2016-12-24 21:01:06 +09:00
MQuy
40b1f648b9 Add document in mailer 2016-12-06 13:47:51 +08:00
MQuy
c4639b7737 allow context type when set body mail 2016-11-30 22:18:14 +08:00
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
Ryuta Kamizono
3464cd5c28 Fix broken comments indentation caused by rubocop auto-correct [ci skip]
All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772.
But comments was still kept absolute position. This commit aligns
comments with method definitions for consistency.
2016-09-14 18:26:32 +09:00
Xavier Noria
810dff7c9f RuboCop is 100% green 🎉 2016-09-02 00:43:33 +02:00
Rafael Mendonça França
0510208dd1
Add load hooks to all tests classes
Usually users extends tests classes doing something like:

    ActionView::TestCase.include MyCustomTestHelpers

This is bad because it will load the ActionView::TestCase right aways
and this will load ActionController::Base making its on_load hooks to
execute early than it should.

One way to fix this is using the on_load hooks of the components like:

    ActiveSupport.on_load(:action_view) do
      ActionView::TestCase.include MyCustomTestHelpers
    end

The problem with this approach is that the test extension will be only
load when ActionView::Base is loaded and this may happen too late in the
test.

To fix this we are adding hooks to people extend the test classes that
will be loaded exactly when the test classes are needed.
2016-08-25 04:22:48 -03:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces

Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Xavier Noria
46f511685c revises more Lint/EndAlignment offenses 2016-08-08 18:25:11 +02:00
Xavier Noria
b326e82dc0 applies remaining conventions across the project 2016-08-06 20:20:22 +02:00
Xavier Noria
80e66cc4d9 normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
Xavier Noria
c3e7abddfb applies new string literal convention in actionmailer/lib
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:01:31 +02:00
yuuji.yaginuma
2a45296114 remove -t option from default sendmail arguments [ci skip]
Follow up to #24436
2016-07-06 18:57:53 +09:00
Jonne Haß
5e3fb2f7b0
Do not suggest nonsensical OpenSSL verify modes [ci skip]
SSL_set_verify(3) explains:

SSL_VERIFY_FAIL_IF_NO_PEER_CERT
  Server mode: if the client did not return a certificate, the TLS/SSL
handshake is immediately terminated with a "handshake failure" alert.
This flag must
  be used together with SSL_VERIFY_PEER.

  Client mode: ignored

SSL_VERIFY_CLIENT_ONCE
  Server mode: only request a client certificate on the initial TLS/SSL
handshake. Do not ask for a client certificate again in case of a
renegotiation.
  This flag must be used together with SSL_VERIFY_PEER.

  Client mode: ignored

The SMTP connection here uses a OpenSSL socket in client mode,
suggesting invalid/ignored flags is rather misleading.
2016-06-07 15:50:46 +02:00
Rajat Bansal
72a0f5e24c fix grammar 2016-05-31 13:31:18 +05:30
Jeremy Daer
e35b98e6f5
Action Mailer: Declarative exception handling with rescue_from.
Follows the same pattern as controllers and jobs. Exceptions raised in
delivery jobs (enqueued by `#deliver_later`) are also delegated to the
mailer's rescue_from handlers, so you can handle the DeserializationError
raised by delivery jobs:

```ruby
class MyMailer < ApplicationMailer
  rescue_from ActiveJob::DeserializationError do
    …
  end
```

ActiveSupport::Rescuable polish:
* Add the `rescue_with_handler` class method so exceptions may be
  handled at the class level without requiring an instance.
* Rationalize `exception.cause` handling. If no handler matches the
  exception, fall back to the handler that matches its cause.
* Handle exceptions raised elsewhere. Pass `object: …` to execute
  the `rescue_from` handler (e.g. a method call or a block to
  instance_exec) against a different object. Defaults to `self`.
2016-05-15 18:44:16 -07:00
Rafael Mendonça França
8ecc5ab1d8 Start Rails 5.1 development 🎉 2016-05-10 03:46:56 -03:00
Pedro Adame Vergara
7cffd6b372 Add :ssl/:tls to ActionMailer [ci skip] 2016-05-09 21:20:29 +02:00
Rafael Mendonça França
fbdcf5221a Preparing for 5.0.0.rc1 release 2016-05-06 16:54:40 -05:00
eileencodes
f7a986012a Prep Rails 5 beta 4 2016-04-27 15:48:47 -05:00
arktisklada
9d63111499
Clear ActionMailer deliveries on setup and teardown
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
2016-04-25 22:41:18 -05:00
Edouard CHIN
106ac1016f Small typo on a method name:
- clear_test_deliviers -> clear_test_deliveries
2016-04-15 13:27:09 -04:00
Vipul A M
aeffcf25b4 Merge pull request #24525 from tomkadwill/action-mailer-base-docs2
Update ActionMailer base documentation [ci skip]
2016-04-14 02:14:58 +05:30
Tom Kadwill
d2f87d7000 Update ActionMailer base documentation [ci skip] 2016-04-13 21:40:03 +01:00
Tom Kadwill
83ac216933 Update ActionMailer Views documentation [ci skip] 2016-04-10 14:31:32 +01:00
Jeremy Daer
2080ff2872 Merge pull request #24457 from jeremy/mailer/dont-deliver-later-after-message-is-loaded
Disallow calling `#deliver_later` after local message modifications.
2016-04-08 18:40:39 -07:00
yuuji.yaginuma
a972fb81f0 remove blank line generated in application_mailer.rb 2016-04-08 06:47:46 +09:00
Jeremy Daer
95e06e6682 Disallow calling #deliver_later after local message modifications.
They would be lost when the delivery job is enqueued, otherwise.
Prevents a common, hard-to-find bug like:

```ruby
message = Notifier.welcome(user, foo)
message.message_id = my_generated_message_id
message.deliver_later
```

The message_id is silently lost here! *Only the mailer arguments are
passed to the delivery job.*

This raises an exception now.

Make modifications to the message within the mailer method or use a
custom Active Job to manage delivery instead of using #deliver_later.
2016-04-07 13:36:50 -07:00
arktisklada
23e4c968d2 Sendmail default arguments match Mail::SendMail
Removes `-t`
2016-04-05 14:11:37 -05:00
Rafael França
878c2bbaaf Merge pull request #24164 from prathamesh-sonpatki/fix-application-mailer
Correctly generate application_mailer.rb in mountable engines
2016-03-23 23:05:26 -03:00
Rafael Mendonça França
07f3ae8f35 Fix generator test to match to use the string 2016-03-21 14:07:38 -03:00
Matt Hall
94ee86c162 switched layout :mailer to a string so that mail layout can be properly found and mail can be delivered properly 2016-03-17 17:13:20 -04:00
Prathamesh Sonpatki
4d0bf49b92 Correctly generate application_mailer.rb in mountable engines
- Followup of https://github.com/rails/rails/pull/24161.
2016-03-12 09:40:54 +05:30
Sen-Zhang
1be9563625 improve some code 2016-03-11 16:59:06 -08:00
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
eileencodes
826420b5fc Prep release for Rails 5 beta3 2016-02-24 10:27:02 -05: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
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
Guillermo Iguaran
012f42a8b9 Update copyright notice for 2016 2016-01-01 12:31:53 -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
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
Marcus Ilgner
5c54db290f
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
2015-12-08 15:50:43 +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
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
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
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
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
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
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
Robin Dupret
0b57f090c9 Tiny documentation edits [ci skip] 2015-06-09 11:49:33 +02: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
Gourav Tiwari
4547d87853 formatting changes [ci skip] 2015-05-17 10:41:27 -07: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
Yves Senn
767d60156b mailer previews for NullMail instances. Closes #19849. 2015-04-28 16:00:08 +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
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
Anton Davydov
435aa7e34f [ci skip] Add code example for MailHelper#block_format documentation 2015-03-02 15:01:57 +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
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
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
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