Commit Graph

585 Commits

Author SHA1 Message Date
Olek Janiszewski
57bfbc249e Allow passing interpolations to #default_i18n_subject, e.g.:
# config/locales/en.yml
    en:
      user_mailer:
        welcome:
          subject: 'Hello, %{username}'

    # app/mailers/user_mailer.rb
    class UserMailer < ActionMailer::Base
      def welcome(user)
        mail(subject: default_i18n_subject(username: user.name))
      end
    end
2013-01-24 15:29:24 +01:00
Rafael Mendonça França
d4c94accf7 Remove unneeded tests
These tests are needed only if we are using MiniTest::Spec
2012-12-31 13:57:24 -03:00
Rafael Mendonça França
5da4d5142a Add active_support/testing/autorun
minitest/autorun load minitest/spec polluting the global namespace with
the DSL that we don't want on Rails
2012-12-31 13:57:24 -03:00
Jeremy Kemper
f9da785d0b Move background jobs to the 'jobs' branch until fully baked. Not shipping with Rails 4.0. 2012-12-21 16:29:47 -08:00
Rafael Mendonça França
287a8d878c Merge pull request #8450 from senny/8448_mailer_return_values
the return value of mailer methods should not be relevant
2012-12-10 06:40:33 -08:00
Yves Senn
ec3429a3d6 The return value from mailer methods is not relevant. 2012-12-10 09:10:47 +01:00
Francesco Rodriguez
4ec7493e3c use _action callbacks in actionmailer 2012-12-08 10:21:20 -05:00
Nate Berkopec
9cf33b55f3 Explicit multipart messages respect :parts_order
As issue #7978, the order in which ActionMailer
sends multipart messages could be unintentionally
overwritten if a block is passed to the mail
method. This changes the mail method such that
:parts_order is always respected, regardless of
whether a block is passed to mail.
2012-11-19 11:27:22 -05:00
Jon Leighton
7e17b0baec Revert "Support Mailer.deliver_foo(*args) as a synonym for Mailer.foo(*args).deliver."
This reverts commit 7e0cf563639bc7508da381b1b8321c7a89be1aa8.

Conflicts:
	actionmailer/CHANGELOG.md

See discussion at
7e0cf56363 (commitcomment-2075489)
2012-10-30 18:43:57 +00:00
Yves Senn
b786f065d3 Do not render views when mail() isn't called. (NullMail refactoring) 2012-10-28 20:45:43 +01:00
Kirill Nikitin
96f290eac0 Update actionmailer with new hash syntax. 2012-10-07 21:54:14 +04:00
Jon Leighton
7e0cf56363 Support Mailer.deliver_foo(*args) as a synonym for Mailer.foo(*args).deliver.
This makes it easy to write e.g. `Mailer.expects(:deliver_foo)` when
testing code that calls the mailer.
2012-09-28 12:13:07 +01:00
Mike Moore
58434e05fe Support mailer tests using spec DSL
Improve how mailer tests to resolve mailers from the test name.
Add tests for mailer tests using the minitest spec DSL.
2012-09-24 14:46:58 -06:00
Mike Moore
0ce383db58 Register mailer tests for minitest's spec DSL 2012-09-24 14:31:05 -06:00
Jeremy Kemper
2a301505ec Use synchronous queue by default. Separate queued message delivery jobs from the queued message wrappers so the queue itself needn't be marshaled (due to queue reference QueuedMessage). 2012-09-16 22:37:47 -07:00
Santiago Pastorino
8577687fcb Move queue classes to ActiveSupport 2012-09-14 14:10:00 -07:00
Rafael Mendonça França
45537f00b4 Allow users to configure the queue for the mailers
This allow the users to do:

    config.action_mailer.queue = MyQueue.new

and

    class UsersMailer < ActionMailer::Base
      self.queue = MyQueue.new
    end
2012-09-12 15:32:22 -03:00
Santiago Pastorino
34b23e7110 Action Mailer async flag is true by default using a Synchronous impl 2012-09-11 15:11:52 -07:00
Aditya Sanghi
8fc8763fde Allow delivery method options to be set per mail instance 2012-09-04 22:34:41 +05:30
kennyj
c34022c2ec Added missing require. When performing rake test:isolated, test/base_test.rb was break. 2012-08-29 23:19:48 +09:00
Francesco Rodriguez
73f0afd1d4 Fix ActionMailer tests that depend on run order 2012-08-23 16:15:31 -05:00
José Valim
485e655082 Revert "Merge pull request #7202 from asanghi/perform_deliveries_in_mail"
Reverting because it feels backward to specify a delivery to not
be performed while the e-mail is being composed. It is simpler (and
makes more sense) to delegate the responsibility to the calling code.
2012-08-07 14:00:54 -03:00
Aditya Sanghi
7c8424e057 allow perform deliveries to be set within mailer action 2012-07-30 23:57:20 +05:30
Carlos Antonio da Silva
9f5d2b1202 Fix failing AM test due to missing template 2012-07-06 23:12:48 -03:00
Robert Pankowecki
edaa2c4817 Introduce config.action_mailer.default_from=
Allows to easily set :from, :replay_to, etc. options in
config/application.rb using simple syntax:

  config.action_mailer.default_options = {from:"no-replay@example.org"}

This was not possible using #default method because

  config.action_mailer.default(from: "no-replay@example.org")

is interpreated as reader method and just returns nil.
It would not call ActionMailer::Base.default method. The only
way of calling this method from config/application.rb was to use
the direct syntax which looks ugly in my opinion:

  config.assets.enabled = false
  config.assets.version = '1.0'
  config.encoding = "utf-8"
  config.action_mailer.default_url_options= {
    host:"example.org",
    protocol:"https"
  }
  ActionMailer::Base.default(from: "no-replay@example.org")
2012-07-03 22:14:08 +00:00
Brian Cardarella
35717a9370 Some final syntax fixes 2012-06-24 17:17:06 -04:00
Brian Cardarella
33334d0ea8 Forcing the message sending is no longer necessary 2012-06-24 04:21:02 -04:00
Brian Cardarella
812d1e88c5 Support for custom queues on the mailer
Credit goes to *Aaron Patterson* (tenderlove)
2012-06-23 23:42:03 -04:00
Brian Cardarella
dc9f6fc046 Force message delivery despite async 2012-06-23 15:12:31 -04:00
Brian Cardarella
dc7fd821dc Asynchronous ActionMailer
Any ActionMailer class can be set to render and delier messages using
the new Rails Queue.

Some of this work was borrowed (with permission) from Nick Plante's
(zapnap) reqsue_mailer gem.
2012-06-23 14:36:09 -04:00
Damien Mathieu
45b1045d16 raise an error if no implicit mailer template could be found 2012-06-20 22:06:31 +02:00
Sergey Nartimov
c17d200e3f mailer can be anonymous
closes #5970
2012-05-13 14:21:00 +03:00
Santiago Pastorino
36dd1857dc Remove useless load path modifications 2012-05-11 19:00:35 -03:00
Marcelo Silveira
3d02195174 No need to work around 1.8 warnings anymore. 2012-05-03 09:10:33 -03:00
Jose and Yehuda
a837b30f84 Clean up some straggling build failures 2012-04-24 23:55:39 -05:00
Justin S. Leitgeb
4f28c4fc9a Add ability to define callbacks in ActionMailer using AbstractController::Callbacks.
Prior to this commit, there isn't a good way of adding things like
default inline attachments to an email.  This Stack Overflow thread
shows people using hooks like the 'default' method in ActionMailer::Base
to call a Proc for message configuration:

http://stackoverflow.com/questions/5113121/rails-use-same-attachment-for-all-emails-using-layout

This has the unintended side effect of setting a message header, so it's not a good solution.

This pull request adds support for message modifications by including AbstractController:Callbacks
in ActionMailer::Base. It includes tests and documentation for the functionality
provided by including this module.
2012-03-11 14:05:31 -05:00
Santiago Pastorino
147c20b629 Fix broken tests 2012-03-10 19:15:29 -02:00
Justin S. Leitgeb
da1a9203b4 Fix actionmailer tests broken by #4751a69 2012-03-10 15:48:55 -05:00
Alexey Vakhov
7f33a44ecd Fix AM format_paragraph helper method if a first word is long 2012-02-15 12:09:00 +04:00
Alexey Vakhov
393d4eca8f Cosmetic fixes in block_format AM helper method + test 2012-02-15 10:31:23 +04:00
Aaron Patterson
b15d2c0708 require minitest rather than test/unit 2012-01-06 15:50:47 -08:00
Aaron Patterson
5d09d395de test cases should inherit from AS::TestCase 2012-01-05 17:05:43 -08:00
Sergey Nartimov
1e9e88fcd3 remove checks for encodings availability 2011-12-25 14:34:58 +03:00
Sergey Nartimov
5ca86ac8f9 deprecate String#encoding_aware? and remove its usage 2011-12-24 15:57:54 +03:00
Alexey Vakhov
0defbc6bfe normalize arg for ActionMailer::TestCase tests method 2011-10-03 14:27:41 +04:00
José Valim
119e9e2daf Get rid of update_details in favor of passing details to find_template. 2011-09-22 15:03:05 +02:00
Arun Agrawal
c302670c84 fixed test_deliver_is_notified need base_mailer 2011-05-25 08:01:56 +05:30
Josh Kalderimis
d500ad3f05 Removed deprecated ActionMailer API and related tests 2011-05-24 18:52:11 +02:00
Mikel Lindsaar
dd44626c7f Updating to use Mail v2.3.0
Need to move the require of mail in test/abstract_unit to be after active support
  to make sure we use ActiveSupport multibyte handlers, otherwise, Mail will load its
  internal multibyte compat
2011-04-26 20:05:59 +10:00
Josh Kalderimis
284ca810c1 remove AM delegating register_observer and register_interceptor to Mail and instead implement smarter versions allowing for string class names, also added proper Railtie support with tests.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-04-04 10:49:09 +02:00
Diego Carrion
8e73e589a8 publicise ActionMailer::MailHelper.format_paragraph
[#6550 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-09 18:36:39 -02:00
Dalibor Nasevic
c528297d17 Fixed indentation in actionmailer base_test [#6538 state:committed]
Signed-off-by: Xavier Noria <fxn@hashref.com>
2011-03-07 00:37:45 +01:00
Dalibor Nasevic
b7cf1f4ccf No need of instance variable
[#6502 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-02 18:01:26 -02:00
Dalibor Nasevic
e4cf28f3a0 Fixed typos in asset_host_test
[#6501 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-02 12:48:33 -02:00
Aaron Patterson
4083e0ea2a removing text-format in favor of a more simple solution 2011-02-09 10:11:29 -08:00
José Valim
262b2ea8cd Solve SystemStackError when changing locale inside ActionMailer [#5329 state:resolved] 2011-01-19 23:42:10 +01:00
Frank Fischer
b247f39442 Added a testcase for bug [#5329]
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-01-19 23:24:57 +01:00
Aaron Patterson
c76c699f30 turn off deprecation silencing 2011-01-12 15:28:57 -08:00
James Mead
f415b3e6d1 Remove old workaround for mocha bug. [#3886 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-10-08 15:21:08 -02:00
Piotr Sarnacki
b7bfeaa9fc Fix action mailer tests after old mapper removal 2010-09-05 13:44:38 +02:00
José Valim
972efa11fd Deprecate the old mailer API that was not deprecated yet. 2010-08-29 20:42:13 -03:00
José Valim
f5a43138d4 Remove the deprecated API from ActionMailer. 2010-08-29 19:57:51 -03:00
José Valim
84cab320bc Ensure templates like template.html are found but still uses the proper virtual path. 2010-08-26 16:07:54 -03:00
Santiago Pastorino
8d1ee434da Silence warnings for Encoding.default_external= and Encoding.default_internal= 2010-08-22 18:43:31 -03:00
Santiago Pastorino
3c0158955a Set default_internal and default_external on AM for testing purposes 2010-08-21 22:53:04 -03:00
Santiago Pastorino
0a22576970 Fixes some ActionMailer tests 2010-08-14 05:58:34 -03:00
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
Piotr Sarnacki
84f0a0bc30 Reload action_methods in AbstractController after defining new method.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-04 14:44:34 -03:00
Jeroen van Dijk and Josh Kalderimis
affeb51569 Move config_accessor :asset_host from ActionController::Base to AbstractController which fixes issues with asset_host in ActionMailer
Including:
  - Moved mailer objects in separate directory
  - Added two tests for asset_host configuration option
2010-07-24 00:27:25 +02:00
Santiago Pastorino
8a09ea6d6d Avoids deprecation warning running tests 2010-07-04 13:52:48 -07:00
Santiago Pastorino
cb321546b7 Time has it own implementation of xmlschema, now AMo doesn't depend on TZInfo
[#4979 state:committed]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-02 01:51:03 +02:00
José Valim
6788db824a Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved] 2010-06-24 13:23:43 +02:00
Santiago Pastorino
ef7a04ea85 Fixes encoding mistakes on old_base/mail_service tests
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 09:26:49 +02:00
David Chelimsky
d588bbd431 Move ActionMailer::TC to AV::TC::Behavior
[#4843 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-12 15:34:31 +02:00
José Valim
30eaecb3df subject is automatically looked up on I18n using mailer_name and action_name as scope as in t('.subject') 2010-06-12 15:33:12 +02:00
Mikel Lindsaar
311d99eef0 Adding inline attachment support to ActionMailer 2010-06-07 21:54:53 -04:00
Mikel Lindsaar
735027e58d Updating ActionMailer to Mail 2.2.2 (fixing two tests to suit) 2010-06-07 15:30:08 -04:00
Neeraj Singh
b462952886 Use better assertion methods for testing
[#4645 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-19 10:18:36 +02:00
Neeraj Singh
d00afeaeed Use assert_equal correctly in actionmailer test (exposing one as broken)
[#4626 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-18 16:12:59 +02:00
Mikel Lindsaar
4a8a62058a Changed encoding behaviour of mail, so updated tests in actionmailer and bumped mail version to 2.2.1
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-14 09:27:47 +02:00
Mikel Lindsaar
ceaa100e59 Adding ability for the procs to be called within the instance, allows you to pass results from instance methods to the mail header
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 11:56:08 +02:00
Mikel Lindsaar
08b07b60b6 Adding ability to pass proc's to the ActionMailer class default method
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 11:56:08 +02:00
Santiago Pastorino
76d6a99364 Use explicit source encoding rather than forced UTF-8 from US-ASCII.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-26 14:45:23 -07:00
José Valim
b4fd5e6f1a template_name and template_path should not be added to mail headers. 2010-04-13 23:04:22 +02:00
Mikel Lindsaar
2a793fa2a8 New mail is more intelligent on encoding and decoding 2010-04-11 18:04:57 +10:00
Mikel Lindsaar
bd89c391e8 Cleaning up expectations from the new way mail does it 2010-04-11 18:04:56 +10:00
Mikel Lindsaar
fd9ee49f38 Moved test of QP into mail 2010-04-11 18:04:56 +10:00
Mikel Lindsaar
a9e918f40e Don't need no quoting test, done in mail 2010-04-11 18:04:56 +10:00
Mikel Lindsaar
03dd8f7917 Mail::Part now no longer has nil as a default charset, it is always set to something, and defaults to UTF-8 2010-04-11 18:04:55 +10:00
Mikel Lindsaar
6c6bef245a Fixing up some bad test cases 2010-04-11 18:04:55 +10:00
Mikel Lindsaar
dbcf01e631 Removing quoting.rb, upgrade to 2.1.3.6, changing all utf-8 references to UTF-8, updating tests where incorrect encoding 2010-04-11 18:04:55 +10:00
Mikel Lindsaar
4e0d1cfad7 Fixing up attachment encoding specs to work with latest mail - and be correct 2010-03-28 17:03:33 +11:00
Mikel Lindsaar
b91c57d16c Mail now correctly bundles up the charset into the content type field 2010-03-28 16:24:54 +11:00
Mikel Lindsaar
a41d1b1fb1 Updating test, should be calling :decoded, not :encoded, is a problem now that Mail is fixed 2010-03-28 16:22:37 +11:00
Mikel Lindsaar
63002ba36b Fixing test, ; is a delimiter, not a termination character, ref RFC 2045 2010-03-28 15:24:35 +11:00
Evan Phoenix
1e4be20672 Fix ActionMailer test issues
* Don't depend so much no the message in a NameError
* Reset the delivery method properly
2010-03-22 10:00:03 -07:00
José Valim
f28d856cec Improve performance of the rendering stack by freezing formats as a sign that they shouldn't be further modified. 2010-03-19 17:20:20 +01:00
Carlhuda
9da153c2d3 Fix an error in isolated running of tests 2010-03-18 11:31:52 -07:00
Jeremy Kemper
fe2f383cf3 Fix broken test due to constant collision 2010-03-17 22:27:34 -07:00
Jeremy Kemper
db9e67a6c8 Kill nonexistent method removal 2010-03-17 21:43:01 -07:00
wycats
a5587efc19 Remove some 1.9 warnings (resulting in some fixed bugs). Remaining AM warnings are in dependencies. 2010-03-17 00:20:09 -07:00
wycats
cd9ffd11e1 Eliminate warnings for AM on 1.8 2010-03-16 23:24:00 -07:00
José Valim
f2c0a353ae Finish cleaning up rendering stack from views and move assigns evaluation to controller (so plugins and/or controllers can overwrite just one method). 2010-03-12 20:39:53 +01:00
Carlhuda
46bf2f04a8 Fixed a broken AM test. I'm unsure how this passed before. 2010-03-04 17:44:16 -08:00
Carl Lerche
05b9382e29 Update the ActionMailer tests to run off of the latest ActionController config refactor 2010-03-04 01:12:16 -08:00
Carl Lerche
ad2e6ee4ec Fix a bunch of failing AP / AM specs created from the previous AbstractController configuration refactor. 2010-03-04 01:01:21 -08:00
Carl Lerche
05f27761a2 Fix action_mailer tests 2010-03-02 22:55:09 -08:00
Joshua Peek
f0fe555d84 fix up actionmailer load path 2010-02-28 18:18:21 -06:00
Carlhuda
98f77e0827 Rename named_url_helpers to url_helpers and url_helpers to url_for 2010-02-26 15:04:50 -08:00
Carlhuda
1fb2c6f635 Get ActionMailer's tests passing with the non global router 2010-02-25 17:53:01 -08:00
Carlhuda
24ab5665b2 Revert "Fix test load paths for those not using bundler"
This reverts commit eec2d301d4ce9df9c71c1a5aa63053eb970b6818.

This commit broke tests. You cannot have a file called "bundler" on the load path.
2010-02-23 17:31:17 -08:00
Mikel Lindsaar
cefc136ec3 Adding options to register observers and interceptors through ActionMailer::Base.register_observer and ActionMailer::Base.register_interceptor. These hook into Mail.register_interceptor and Mail.register_observer. Also bumped Mail requirement to 2.1.3
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-02-22 09:15:48 +01:00
Martin Schürrer
6bc24d40d5 Use ActionDispatch::Routing everywhere 2010-02-21 13:43:51 -08:00
José Valim
be35a1510d Allow to choose the template path and template name used in implicit rendering with ActionMailer. 2010-02-19 10:51:17 +01:00
José Valim
3f948a0e29 Merge master. 2010-02-17 00:48:04 +01:00
Prem Sichanugrist
f0523f72b4 Rename Rails::Subscriber to Rails::LogSubscriber 2010-02-16 22:36:15 +01:00
Joshua Peek
eec2d301d4 Fix test load paths for those not using bundler 2010-02-15 10:20:11 -06:00
Mikel Lindsaar
bb55bbd207 Fixing actionmailer tests for CI 2010-02-06 23:36:03 -08:00
Santiago Pastorino and José Ignacio Costa
6d6e6105c0 require 'action_controller' added on a test that uses it
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-02-04 14:07:24 +01:00
José Valim
d74b5e440c Make AM test suite green. 2010-02-01 23:34:47 +01:00
Jeremy Kemper
e5ab4b0d07 Convert to class_attribute 2010-02-01 02:02:42 -08:00
Carl Lerche
9f01dff9c2 Get rails tests running on bundler 0.9 2010-01-31 19:13:43 -08:00
José Valim
2d567e470a Add transfer_encoding= setter deprecation. 2010-01-30 16:39:27 +01:00
José Valim
17ea8d8d4d Automatically configure generators if application is defined. 2010-01-29 17:51:06 +01:00
José Valim
3f84091937 ActionMailer should depend just on AbstractController. 2010-01-29 17:51:05 +01:00
Mikel Lindsaar
2960077445 Add a failing test case for render :layout
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-29 17:51:05 +01:00
Mikel Lindsaar
1024c11f3c Added tests for rendering different template for new API
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-29 17:51:05 +01:00
Jeremy Kemper
452bb1e48d Rename 'defaults' class method to 'default' to reflect that it's a declaration 2010-01-27 19:38:17 -08:00
Jeremy Kemper
187b3b0b48 Fix time comparison. Mail#date returns DateTime not Time. 2010-01-27 19:08:36 -08:00
Jeremy Kemper
8c60acbea2 Expected attachment encoding is binary 2010-01-27 18:37:17 -08:00
Mikel Lindsaar
b6b3db6734 Fixed bug on HTML only emails getting set to text/plain 2010-01-28 00:24:30 +11:00
José Valim
9f63c4b26e Bring AM tests back to green again. 2010-01-26 19:50:59 +01:00
José Valim
af43674c1c Fix failing tests on AM about render(:body => Hash). 2010-01-26 19:15:32 +01:00
Joshua Peek
31b538df64 Failing AM test for legacy multipart alternative rendering 2010-01-26 09:37:20 -06:00
Joshua Peek
9f7190187c Failing AM test for nested layouts 2010-01-26 09:27:54 -06:00
José Valim and Mikel Lindsaar
05c4ad9d3f Tidy up tests and docs. 2010-01-26 16:00:24 +01:00
Mikel Lindsaar
ccea6ab07d Fixing up tests and docs to use defaults :from => 'name' instead of defaults({:from => 'name'}) 2010-01-27 00:38:12 +11:00
Mikel Lindsaar
21dcc20ed2 Fixed up documentation to reflect code change and cleaned up tests of spurious #deliver calls 2010-01-27 00:18:40 +11:00
Mikel Lindsaar
9520166f70 Fixed up being able to pass random headers in with headers, or mail. Also, undeprecated headers(hash) as this works now too 2010-01-27 00:06:19 +11:00
José Valim and Mikel Lindsaar
9dd65c368b Make defaults accept a hash. 2010-01-26 11:21:20 +01:00
Mikel Lindsaar
e297eed4f2 Fixing up expectations in base_test.rb 2010-01-26 17:11:36 +11:00
Mikel Lindsaar
0b05acd424 Implementing class level :defaults hash, instead of delivers_from et al 2010-01-26 17:08:55 +11:00
José Valim and Mikel Lindsaar
c02391f8f9 Fix small typo. 2010-01-26 01:54:23 +01:00
José Valim and Mikel Lindsaar
4af2bbc6b4 Merge branch 'master' of github.com:mikel/rails 2010-01-26 01:51:23 +01:00
José Valim and Mikel Lindsaar
74a5889abe Refactor content type setting, added tests to ensure boundary exists on multipart and fixed typo 2010-01-26 11:49:59 +11:00
José Valim and Mikel Lindsaar
6589976533 Remove old files, add some information to docs and improve test suite. 2010-01-26 01:43:41 +01:00
José Valim and Mikel Lindsaar
ace74974cf Got AM working with Mail yield on delivery_handler and updated tests 2010-01-25 21:47:03 +11:00
José Valim and Mikel Lindsaar
4240369a43 changed test to get TestMailer to use :file delivery method directly (as setup action was resetting delivery_method to :test on init 2010-01-25 13:46:44 +11:00
José Valim and Mikel Lindsaar
e4a989e9d9 Added delivery_handler method to mail and implemented in ActionMailer to deliver inside of instrumentation 2010-01-25 13:39:48 +11:00
José Valim and Mikel Lindsaar
e1c1318638 Added delivers_from. 2010-01-25 00:37:12 +01:00
José Valim and Mikel Lindsaar
48faf53be1 Add some view paths tests. 2010-01-25 00:20:38 +01:00
José Valim and Mikel Lindsaar
0ece244fee Ensure implicit multipart templates with locale works as expected. 2010-01-24 23:59:12 +01:00
José Valim and Mikel Lindsaar
a74a655648 Add tests to mail helper. 2010-01-24 19:52:50 +01:00
José Valim and Mikel Lindsaar
bd96614101 Move old tests to a specific folder and add some delivery method tests. 2010-01-24 19:36:42 +01:00
José Valim and Mikel Lindsaar
99f960a3d7 Handle some TODOs and deprecations. 2010-01-24 18:40:04 +01:00
José Valim and Mikel Lindsaar
0d931fecbb Finish cleaning up delivery methods implementation. 2010-01-24 18:11:57 +01:00
José Valim and Mikel Lindsaar
f30d73bab4 Add new class delivery method API. 2010-01-24 17:31:18 +01:00
José Valim and Mikel Lindsaar
73a9000402 Adding failing tests for calling just the action, instead of :create_action_name and :deliver_action_name 2010-01-24 20:38:53 +11:00
José Valim and Mikel Lindsaar
afc758297c Moving AS::Notifications call to one location in base 2010-01-24 12:30:13 +11:00
José Valim and Mikel Lindsaar
258ca14800 Delegated ActionMailer::Base.deliveries to Mail.deliveries, added callback support in Mail to call ActionMailer on delivery, moved deliver to deprecated API in preparation for new API 2010-01-24 11:15:42 +11:00
José Valim and Mikel Lindsaar
e7e4ed48df Set sort order for explicit parts from the collector's template sequence 2010-01-24 09:34:50 +11:00
José Valim and Mikel Lindsaar
c985a0ee3d Add some tests to collector with templates and any. 2010-01-23 12:46:40 +01:00
José Valim and Mikel Lindsaar
6ba944608e Make implicit and explicit templates pass through the same part creation process. 2010-01-23 12:20:20 +01:00
José Valim and Mikel Lindsaar
c6b16260fe Added basic explicit multipart rendering and tests 2010-01-23 21:37:34 +11:00
José Valim and Mikel Lindsaar
951397b4a2 Get implicit multipart and attachments working together. 2010-01-22 14:38:41 +01:00
José Valim and Mikel Lindsaar
1cd55928c6 First work on implicit multipart. 2010-01-22 13:56:06 +01:00
José Valim and Mikel Lindsaar
dcb9253693 Add basic template rendering to new DSL. 2010-01-22 13:27:26 +01:00
José Valim and Mikel Lindsaar
b30eb39ff0 Add more tests to new API. 2010-01-22 11:57:54 +01:00
José Valim and Mikel Lindsaar
343ac48f45 Moved deprecated_body.rb to deprecatead_api.rb 2010-01-22 11:01:21 +01:00
José Valim and Mikel Lindsaar
8a6a2ca712 Merge branch 'master' of git://github.com/rails/rails 2010-01-22 13:37:29 +11:00
José Valim and Mikel Lindsaar
77986f6bdb Added use of AS::Notifications for tmail_compat.rb 2010-01-22 12:49:13 +11:00
José Valim and Mikel Lindsaar
12c001fec4 Updating deprecated API to sanitize old style attachments hash to work with new mail.attachments method 2010-01-22 12:46:19 +11:00
José Valim
378464a2e4 Default to sync instrumentation. 2010-01-21 13:09:12 +01:00
José Valim and Mikel Lindsaar
3829f9ecfd Adding tests for attachments['blah.rb'] = {} et al 2010-01-21 20:03:55 +11:00
José Valim and Mikel Lindsaar
d3da87ce77 Mail method accepting all headers set via the hash 2010-01-21 00:10:22 +11:00
José Valim and Mikel Lindsaar
c34cfcc29f Created mail method for new API 2010-01-20 23:46:59 +11:00
José Valim and Mikel Lindsaar
10c509fbfa Moved old API into deprecated_api.rb in preparation for new Rails 3 Mailer API 2010-01-20 22:26:24 +11:00
Mikel Lindsaar
c04baed627 Fixing failing test on sendmail expectation 2010-01-20 14:12:17 +11:00
José Valim
e10f51b6b7 Refactor delivery methods. 2010-01-19 15:34:58 +01:00
José Valim
c1848f9736 Get all tests passing. 2010-01-19 14:28:04 +01:00
Mikel Lindsaar
d201d39437 latest updates 2010-01-19 23:09:46 +11:00
Mikel Lindsaar
2107921000 Merge branch 'master' of git://github.com/rails/rails into rails 2010-01-19 21:05:37 +11:00
José Valim
f00cbf7872 Bring render_message back for 2.3 compatibility. 2010-01-19 01:36:07 +01:00
José Valim
a0374582ff Bring body(Hash) behavior back. 2010-01-19 01:36:07 +01:00
Santiago Pastorino
8268d68b50 mail.create_path returns an array test fixed [#3712 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-17 14:54:06 +01:00
Mikel Lindsaar
ccb7d9def3 Fixing up base to refactor settings 2010-01-17 23:27:59 +11:00
Mikel Lindsaar
0750304c01 Migrated over to Mail doing delivery. 2010-01-16 14:02:55 +01:00
José Valim
704daad762 Ensure we just send Ruby Stdlib objects in ActionMailer notifications. 2010-01-15 12:24:31 +01:00
José Valim
2a6bc1263e Add subscriber to ActionMailer. 2010-01-14 01:07:03 +01:00
Mikel Lindsaar
1ddf17dff0 Return-Path per RFC needs '<' and '>' around the addr_spec 2010-01-08 12:17:12 +11:00
Jeremy Kemper
8087d51842 Liberalize picky test 2010-01-07 17:08:02 -08:00
Joshua Peek
ce56c36cd3 Autoload AM test case class 2010-01-04 16:22:46 -06:00
Mikel Lindsaar
bf6d0e2bc2 Updating to Mail 1.5.0, including default values for all Message#field_name methods, can access field objects by calling Message#[:field_name] 2010-01-02 22:39:00 -08:00
Mikel Lindsaar
a2880827b4 Adding :transfer_encoding -> :content_transfer_encoding as part of TmailCompat 2009-12-31 19:37:37 +11:00
Mikel Lindsaar
345e622a20 Adding TMailCompat layer for :set_content_type and friends 2009-12-30 16:12:51 +11:00
Jeremy Kemper
b27a3e8da3 Merge branch 'master' of git://github.com/mikel/rails into mail
Conflicts:
	actionmailer/lib/action_mailer.rb
2009-12-29 15:46:12 -08:00
Mikel Lindsaar
b354496bda Adding default 8bit encoding if the body has non usascii in it 2009-12-28 21:41:16 +11:00
Mikel Lindsaar
c039bcdb1c Moved sort_parts into Mail, updated mail requirement to 1.4.2 2009-12-28 12:25:14 +11:00
José Valim
4747a9a57e Getting rid of some warnings in AM suite. 2009-12-27 12:18:46 +01:00
José Valim
47e5caa96b Merge Mail with latest Rails and move mail gem to Gemfile. 2009-12-27 12:09:20 +01:00
Mikel Lindsaar
331d375cc3 Changing body to use :to_s instead of :decoded... better use case 2009-12-27 20:56:16 +11:00
Mikel Lindsaar
4e1fa4912d Updating actionmailer to call :to_s on all field values instead of decoded 2009-12-27 18:38:30 +11:00
José Valim
ee70d1b6ad adv_attr_accessors in ActionMailer are not sent to the views, use the mailer object if you need to access the subject, recipients, from, etc. 2009-12-25 21:35:40 +01:00
José Valim
4964d3b02c Make ActionMailer::Base inherit from AbstractController::Base
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-12-22 11:29:06 -08:00
Mikel Lindsaar
63b124b043 Merged in latest changes from rails/master 2009-12-17 12:23:08 +11:00
Mikel Lindsaar
418639b4cf Fixes for working with 1.9.1-head 2009-12-17 12:00:32 +11:00
Mikel Lindsaar
186cd7bc53 Merge branch 'rails'
Conflicts:
	actionmailer/lib/action_mailer.rb
	actionmailer/lib/action_mailer/delivery_method/smtp.rb
2009-12-17 11:24:02 +11:00
Joshua Peek
7ee5843c3c Fully expand relative rails framework paths and make sure we aren't
adding any to the load path more than once.
2009-12-16 11:56:51 -06:00
Joshua Peek
6ac32a8328 Define a welcome controller in mailer tests 2009-11-29 18:28:45 -06:00
Michael Koziarski
7e0aa35c20 avoid generating invalid SMTP commands in ruby pre 1.9
Signed-off-by: Michael Koziarski <michael@koziarski.com>

Conflicts:

	actionmailer/lib/action_mailer/base.rb
2009-11-28 13:34:05 +13:00
Mikel Lindsaar
5f2395041d Merge branch 'master' of git://github.com/rails/rails into rails_master 2009-11-24 21:45:14 +11:00
Jeremy Kemper
671538cd6e Merge commit 'mikel/master' into mail
Conflicts:
	actionmailer/lib/action_mailer.rb
2009-11-23 15:29:35 -08:00
Mikel Lindsaar
906e308220 Fixed up incompatible encoding problem for Ruby 1.9 in test suite 2009-11-23 20:58:22 +11:00
Mikel Lindsaar
cc391c3022 Deprecating attachment :body => 'string' in favour of attachment :data => 'string' 2009-11-23 20:53:07 +11:00
Jeremy Kemper
d98fee67e2 Never require jcode 2009-11-22 15:41:29 -08:00
Jeremy Kemper
e68bc3f14e Merge commit 'origin/master' into mail 2009-11-22 10:31:47 -08:00
Mikel Lindsaar
747d56881a 131 tests, 309 assertions, 0 failures, 0 errors 2009-11-22 23:20:57 +11:00
Mikel Lindsaar
f6f70540bb Updating tests for Mail gem 2009-11-22 00:04:36 +11:00
Mikel Lindsaar
0e38f5bdcc 131 tests, 266 assertions, 9 failures, 6 errors 2009-11-21 23:55:53 +11:00
Mikel Lindsaar
6456a08334 Down to 13 failures, 14 errors 2009-11-20 22:01:40 +11:00
Mikel Lindsaar
a5e6295d72 Down to 30 failures total 2009-11-20 21:19:10 +11:00
Mikel Lindsaar
539d9b355f More updates... 45 errors left to get it working with Mail gem 2009-11-20 14:10:57 +11:00
Mikel Lindsaar
15d7cac282 Starting again on actionmailer integration with mail 2009-11-12 16:08:50 +11:00
Joshua Peek
11e798ae0f Avoid adding component lib/ to load path multiple times 2009-11-09 23:28:36 -06:00
José Valim
4a1f438781 Change mailer subjects lookup. 2009-11-09 10:57:53 -08:00
José Valim
2aafdc8396 Use I18n on ActionMailer subjects by default. 2009-11-01 02:23:49 +01:00
José Valim
e9667ad1f0 Make tests run without deprecation warning (just one left). 2009-11-01 02:23:48 +01:00
José Valim
418c3f801c Another refactoring on AM. body is deprecated, use render instead. 2009-11-01 02:23:48 +01:00
José Valim
43d5504f0a Move all render and layout pieces required in ActionMailer from ActionController to AbstractController. 2009-11-01 02:23:48 +01:00
José Valim
684c2dc208 Remove ActionMailer helpers and rely on AbstractController one. 2009-11-01 02:23:48 +01:00
Matthew Rudy Jacobs
f4f76772fb abstract all of the ActionMailer delivery methods into their own classes. thereby the following are equivalent
ActionMailer::Base.delivery_method = :smtp
  ActionMailer::Base.delivery_method = ActionMailer::DeliveryMethod::Smtp

we could equally set our own custom object
as long as it provides the instance method :perform_delivery(mail)

eg.

  class MySmsDeliveryMethod
    def perform_delivery(mail)
      Sms.send(mail['to'], mail['body'])
    end
  end

  MySmsMailer.delivery_method = MySmsDeliveryMethod.new

Signed-off-by: José Valim <jose.valim@gmail.com>
2009-11-01 02:23:47 +01:00
Yehuda Katz + Carl Lerche
4f6d6f7031 Have all the tests running off a single Gemfile 2009-10-20 16:34:44 -07:00
Joshua Peek
3ccaabc6c6 Need to use "use_controllers" for nonexistent controller in AM test 2009-10-18 10:39:21 -05:00
Yehuda Katz
e1490d4e4c Change config implementation in AV slightly 2009-10-15 14:41:59 -07:00
Jeremy Kemper
d5de94d6b7 Fix AM tests by configuring AV 2009-10-15 00:22:15 -07:00
Jeremy Kemper
4484f0bccf Don't push siblings on load path if using bundled env 2009-10-14 20:59:45 -07:00
Jeremy Kemper
6395c7bed2 Mark html safety 2009-10-09 18:36:58 -07:00
Pratik Naik
96b575d6dc Get rid of parenthesize argument warnings 2009-08-09 16:00:53 +01:00
Eric Davis
fbe6c3c195 Adds a :file delivery_method to save email to a file on disk
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2438 state:committed]
2009-08-08 16:32:17 +12:00
Matt Duncan
5fdc33c1a3 Default sent_on time to now in ActionMailer
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2607 state:committed]
2009-08-08 14:11:32 +12:00
Yehuda Katz
0612fd0f09 Replace _render_template_with_layout with _render_template since the layout is optional 2009-08-07 03:18:45 -03:00
Yehuda Katz + Carl Lerche
7583a24ee0 Move mocha down below initial T::U require and bump version to 0.9.7 [#2858 state:resolved] 2009-07-01 11:53:17 -07:00
Chad Woolley
5679bf64d5 Fix failing CI test (broken in 2daac47 or e693f45): make test_multipart_with_template_path_with_dots only test path with dots, and stop failing on unrelated mimetype assertion. The image/jpeg multipart content type is already tested in test_explicitly_multipart_messages.
Signed-off-by: Yehuda Katz <wycats@yehuda-katzs-macbookpro41.local>
2009-05-27 21:38:23 +02:00
Jeremy Kemper
df2d96a7f0 Move misplaced test 2009-05-22 15:32:35 -07:00
Yehuda Katz + Carl Lerche
ab83db9d06 Fixes ActionMailer to work with the ActionView refactoring 2009-04-27 12:34:25 -07:00
Yehuda Katz + Carl Lerche
0a132c2fe1 Refactor ActionView::Path
* Decouple from ActionController and ActionMailer
  * Bring back localization support.
  * Prepare to decouple templates from the filesystem.
  * Prepare to decouple localization from ActionView
  * Fix ActionMailer to take advantage of ActionView::Path
2009-04-22 17:24:41 -07:00
Carl Lerche & Yehuda Katz
906aebceed Bring abstract_controller up to date with rails/master
Resolved all the conflicts since 2.3.0 -> HEAD. Following is a list
of commits that could not be applied cleanly or are obviated with the
abstract_controller refactor. They all need to be revisited to ensure
that fixes made in 2.3 do not reappear in 3.0:

2259ecf368e6a6715966f69216e3ee86bf1a82a7
AR not available
  * This will be reimplemented with ActionORM or equivalent

06182ea02e92afad579998aa80144588e8865ac3
implicitly rendering a js response should not use the default layout
[#1844 state:resolved]
  * This will be handled generically

893e9eb99504705419ad6edac14d00e71cef5f12
Improve view rendering performance in development mode and reinstate
template recompiling in production [#1909 state:resolved]
  * We will need to reimplement rails-dev-boost on top of the refactor;
    the changes here are very implementation specific and cannot be
    cleanly applied. The following commits are implicated:

      199e750d46c04970b5e7684998d09405648ecbd4
      3942cb406e1d5db0ac00e03153809cc8dc4cc4db
      f8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690
      e3b166aab37ddc2fbab030b146eb61713b91bf55
      ae9f258e03c9fd5088da12c1c6cd216cc89a01f7
      44423126c6f6133a1d9cf1d0832b527e8711d40f

0cb020b4d6d838025859bd60fb8151c8e21b8e84
workaround for picking layouts based on wrong view_paths
[#1974 state:resolved]
  * The specifics of this commit no longer apply. Since it is a two-line
    commit, we will reimplement this change.

8c5cc66a831aadb159f3daaffa4208064c30af0e
make action_controller/layouts pick templates from the current instance's
view_paths instead of the class view_paths [#1974 state:resolved]
  * This does not apply at all. It should be trivial to apply the feature
    to the reimplemented ActionController::Base.

87e8b162463f13bd50d27398f020769460a770e3
fix HTML fallback for explicit templates [#2052 state:resolved]
  * There were a number of patches related to this that simply compounded
    each other. Basically none of them apply cleanly, and the underlying
    issue needs to be revisited. After discussing the underlying problem
    with Koz, we will defer these fixes for further discussion.
2009-04-13 15:18:45 -07:00
Sean Dague
1dff106888 Allow custom type for multipart emails [#1691 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-10 16:38:37 +00:00
Jeremy Kemper
1c36172c13 Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.
[#1617 state:resolved]
2009-03-08 13:11:58 -07:00
Elliott Wood
c41ed929bb Removed the "charset" parameter from the Content-Type header of multipart sections of nested multipart messages.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2109 state:committed]
2009-03-02 18:51:30 +13:00