Skip to content

Navigation Menu

Sign up

How To: Send emails from subdomains

tasiu edited this page Dec 17, 2010 · 8 revisions

Devise sends registration confirmations, forgotten password messages, and other email messages. These will originate from the main domain by default, but you can modify the application so these emails originate from subdomains.

Add the following code to the file app/helpers/url_helper.rb:

def set_mailer_url_options
 ActionMailer::Base.default_url_options[:host] = with_subdomain(request.subdomain)
end

and modify the file app/controllers/application_controller.rb to add:
include UrlHelper
before_filter :set_mailer_url_options

This information is provided from http://github.com/fortuity/rails3-subdomain-devise/blob/master/TUTORIAL.textile and Thanks to Tom Howlett for this contribution.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /