Commit Graph

84 Commits

Author SHA1 Message Date
John Hawthorn
4e6c8045c3 Add test and change how format set in ActionMailer
Previously this used self.formats= to set the format which render would
use to find templates. This worked, but was untested, and looked a
little confusing because it was doing the mutation within a loop.

This commit replaces the assignment with passing formats: [format] into
the render call, which makes it more obvious that that's the purpose of
the format. It also adds a test to verify the formats being used.
2019-03-01 14:07:59 -08:00
Vipul A M
cbb25c4b1c Expand on Action Mailer Fragment caching tests 2016-04-17 23:16:09 +05:30
Stan Lo
049b6e670f Porting ActionController::Caching to ActionMailer::Caching 2016-02-23 21:04:16 -03: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
Thiago Pradi
bc970e8335 Removing unused mailer templates 2015-03-01 16:07:24 -03: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
Xavier Noria
9685080a76 let mailer templates generate URLs by default [Xavier Noria, Richard Schneeman] 2014-11-24 14:33:50 -08:00
Christian Felder (masone)
b37e8482ca Allow attaching files while the mail view is rendered 2014-09-22 15:52:48 +02:00
Dmitry Polushkin
99f8d4feeb add test coverage for the action mailer 2014-07-04 15:55:33 +01:00
Mr A
3134605391 Ruby's new Hash syntax applied in actionmailer 2013-11-14 13:41:37 +05:30
claudiob
d17333d10c Remove unused raw email fixtures
The tests that used the raw_email_* fixtures were removed in d500ad3
2013-09-12 01:09:32 -07:00
Francesco Rodriguez
4ec7493e3c use _action callbacks in actionmailer 2012-12-08 10:21:20 -05:00
Yves Senn
b786f065d3 Do not render views when mail() isn't called. (NullMail refactoring) 2012-10-28 20:45:43 +01: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
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
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
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -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
Mikel Lindsaar
311d99eef0 Adding inline attachment support to ActionMailer 2010-06-07 21:54:53 -04: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
Jeremy Kemper
fe2f383cf3 Fix broken test due to constant collision 2010-03-17 22:27:34 -07: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
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
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
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
c985a0ee3d Add some tests to collector with templates and any. 2010-01-23 12:46:40 +01: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
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
Jeremy Kemper
6395c7bed2 Mark html safety 2009-10-09 18:36:58 -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
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
Tekin Suleyman
dab78e55cf Ensure ActionMailer doesn't blow up when a two argument proc is set for the asset host
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1394 state:committed]
2008-12-01 19:38:25 +01:00
Colin Curtin
1d4554d766 ActionMailer should respect content type when choosing layouts
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-11-21 04:09:14 +05:30
Joshua Peek
28bf2fa038 Protect body ivar from being clobbered by the mailer template assigns 2008-09-28 12:31:45 -05:00
U-ESCAPEE\Mack
f3f7d166d8 Fixed problem causes by leftover backup templates ending in tilde [state:committed #969]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2008-09-09 23:29:29 -05:00
David Heinemeier Hansson
6228220c9b Revert "Revert "Add layout functionality to mailers.""
This reverts commit 36c6aa01ee0a7aee5b0510a8e649c44de318b060.
2008-09-09 17:25:09 -05:00
David Heinemeier Hansson
36c6aa01ee Revert "Add layout functionality to mailers."
This reverts commit e9a8e0053be3b293ab89fb584f1d660063f107aa.
2008-09-09 17:20:55 -05:00
Pratik Naik
e9a8e0053b Add layout functionality to mailers.
Mailer layouts behaves just like controller layouts, except layout names need to
have '_mailer' postfix for them to be automatically picked up.
2008-08-31 19:17:42 +01:00
Joshua Peek
04248c6208 Ensure templates are rendered if all the parts are already processed 2008-08-13 19:04:56 -05:00
Jeremy Kemper
940cf0cacd Bah, don't test TMail in AM
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9219 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-03 18:32:10 +00:00
Jeremy Kemper
218417b8a9 Remove empty .rhtml templates
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8820 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-07 23:10:01 +00:00