spree/spree — pull request #2918 by huoxito (2013-04-21 16:50:25+00:00)
Title: Allow users to not override default mailer configs (1-3-stable)

Here goes my suggestion for the issue reported in #2855. It adds an explicit configuration option which allow users to skip any mailing setting defined in Spree. I believe there must be cases where Spree would be just one part of a bigger application where ``Spree::Core::MailSettings`` may not fit. In that case users would have to set ``override_actionmailer_config = false``.

This should also fix the ``from_address`` method in mailers, it broke when there were no mail_method record on the database.

I haven't changed the ``Spree::Core::MailInterceptor`` yet to check the new config option. But I think we definitely should. Please let me know your thoughts about it. I have experienced situations where that interceptor would override others completely, e.g. the notification_exception gem which would then also send errors messages to clients instead of only to the dev team.

Once that's done it would make sense imo to hide the Mail Method tab from admin. Also I don't think it makes sense to change ``override_actionmailer_config`` via UI because turning that to ``false`` will likely require changes on the app code anyway.

I've opened this for 1-3-stable because the patch will need slightly different tweaks once #2643 gets merged. I may open another PR to master in case this one gets accepted.

please let me know your thoughts about it