Commit Graph

40 Commits

Author SHA1 Message Date
Yves Senn
23aa94a7b2 mail() without arguments is a getter for the current mail.
This behavior is documented in our guides (http://edgeguides.rubyonrails.org/action_mailer_basics.html#action-mailer-callbacks)
but was broken in the past. This commit short curcuits
the `mail` method if:

  1. mail() was previously called
  2. no headers are passed
  3. no block is passed

Closes #13090.

/cc @pixeltrix
2013-12-02 16:56:31 +01:00
Carlos Antonio da Silva
18964368f3 Improve changelogs
Also make Action Mailer changelog format more consistent with the
others [ci skip]
2013-11-22 08:30:04 -02:00
Daniel Schierbeck
8f0c5e00ff Instrument the generation of Action Mailer messages
The processing of outbound mail is instrumented with the key
`process.action_mailer`. The payload includes the mailer name as well as
the mailer method.
2013-10-20 15:21:15 +02:00
Alex Tsukernik
49185875a5 don't convert mailer default values to procs
Invoke mailer defaults as procs only if they are procs, do not convert
with to_proc.  That an object is convertible to a proc does not mean it's
meant to be always used as a proc.  Fixes #11533
2013-07-22 14:25:20 -04:00
Rafael Mendonça França
97a607b32b No need CHANGELOG entry for a test fix
[ci skip]
2013-05-20 15:17:11 -03:00
kennyj
98849c71ac Fix AM testcase break with mail 2.5.4. It seems that AM's testcase was wrong. 2013-05-17 09:44:01 +09:00
Rafael Mendonça França
feb44b9213 rails/master is now 4.1.0.beta 2013-04-29 13:15:24 -03:00
Xavier Noria
e79d2c8aa6 copy-edit pass in AM changelog [ci skip] 2013-04-09 22:41:03 +02:00
Yves Senn
a58e660837 Use "Fixes" in place of "Fix" in changelogs for consistency [ci skip]. 2013-03-09 20:57:17 +01:00
Rafael Mendonça França
0f75e2c51f Update CHANGELOGS 2013-02-26 13:45:57 -03:00
David Heinemeier Hansson
c0bc9ce38c Preparing for 4.0.0.beta1 release 2013-02-25 08:31:50 -06:00
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
Jon Leighton
15b7482dfc Merge pull request #8568 from inossidabile/fix-in_clause_length
Correct source for in_clause_length for eager loading (Fix for #8474)
2013-01-11 01:34:43 -08: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
Boris Staal
1a7567d2af Eager loading made to use relation's in_clause_length instead of host's one (fixes #8474) 2012-12-20 19:51:25 +07:00
Carlos Antonio da Silva
42b555dcf3 Fix Action Mailer changelog indenation to match other changelogs
Also some minor improvements to other changelogs. [ci skip]
2012-12-19 23:09:04 -02:00
Carlos Antonio da Silva
df9f9b7f3e Convert changelogs to 1.9 hash style and fix some formatting [ci skip] 2012-12-14 20:25:22 -02:00
Yves Senn
ec3429a3d6 The return value from mailer methods is not relevant. 2012-12-10 09:10:47 +01: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
Aditya Sanghi
74bd13479b Add missing CHANGELOG related to addition of callbacks to mailers. 2012-10-10 15:28:37 +05:30
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
Aditya Sanghi
75dc1950e0 fix bad changelog example 2012-09-07 01:39:27 +05:30
Aditya Sanghi
8fc8763fde Allow delivery method options to be set per mail instance 2012-09-04 22:34:41 +05:30
Xavier Noria
810a50dacf CHANGELOGs are now per branch
Changes in old branches needed to be manually synched in CHANGELOGs of newer ones.
This has proven to be brittle, sometimes one just forgets this manual step.
With this commit we switch to CHANGELOGs per branch. When a new major version is
cut from master, the CHANGELOGs in master start being blank.

A link to the CHANGELOG of the previous branch allows anyone interested to
follow the history.
2012-08-28 21:15:16 +02:00
Rafael Mendonça França
8781b266b9 Sync CHANGELOGs [ci skip] 2012-08-11 13:13:58 -03: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
951503819e add changelog for #7202 2012-08-07 00:08:25 +05:30
Carlos Antonio da Silva
3009c63da6 Improve docs, changelog and release notes for Action Mailer default_options=
[ci skip]
2012-07-06 22:51:32 -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
d1d6c364d0 Updated Changelogs 2012-06-23 15:21:33 -04:00
Damien Mathieu
45b1045d16 raise an error if no implicit mailer template could be found 2012-06-20 22:06:31 +02:00
Rafael Mendonça França
3449b757da Sync CHANGLOG with the 3-2-stable branch 2012-06-01 11:41:30 -03:00
Michael de Silva
363888109f Update Rails 3.2.3 release date in changelogs as March 30, 2012
The release date details have been taken from
http://weblog.rubyonrails.org/2012/3/30/ann-rails-3-2-3-has-been-released/
2012-04-16 13:20:53 +03:00
Rafael Mendonça França
d804790634 Fix my name in the CHANGELOG to follow the convention
Also add missing entries and use the formating convention
2012-03-09 00:54:21 -03:00
Vijay Dev
8a714c4d80 fix incorrect changelog headings [ci skip].
Last commit message should not have said 'Rails 4' either
2012-03-09 02:30:49 +05:30
Vijay Dev
db6542178c changelog updates for Rails 4 [ci skip] 2012-03-09 02:22:17 +05:30
Paco Guzman
152a393d4f Update changelogs with rails 3.0-stable branch info 2012-02-25 13:50:08 +01:00
Jon Leighton
281272ad36 Convert CHANGELOGs to Markdown format.
Reasons:

 * Markdown reads well as plain text, but can also be formatted.
 * It will make it easier for people to read on the web as Github
   formats the Markdown nicely.
 * It will encourage a level of consistency when people are writing
   CHANGELOG entries.

The script used to perform the conversion is at
https://gist.github.com/1339263
2011-11-04 12:55:17 +00:00