Merge branch 'master' of github.com:domify/registry

Conflicts:
	CHANGELOG.md
	app/mailers/domain_mailer.rb
	app/models/domain.rb
	app/views/layouts/registrant/application.haml
	config/application-example.yml
	config/locales/en.yml
	config/routes.rb
	spec/mailers/domain_mailer_spec.rb
This commit is contained in:
Martin Lensment 2015-05-14 18:01:06 +03:00
commit 412ececd9c
13 changed files with 82 additions and 25 deletions

View file

@ -1,18 +1,18 @@
class DomainMailer < ApplicationMailer
def registrant_updated(domain)
return if Rails.env.production? ? false : !TEST_EMAILS.include?(domain.registrant_email)
@domain = domain
return if Rails.env.production? ? false : !TEST_EMAILS.include?(@domain.registrant_email)
# turn on delivery on specific request only, thus rake tasks does not deliver anything
return if domain.deliver_emails != true
if domain.registrant_verification_token.blank?
return if @domain.deliver_emails != true
if @domain.registrant_verification_token.blank?
logger.warn "EMAIL DID NOT DELIVERED: registrant_verification_token is missing for #{@domain.name}"
return
return
end
@old_registrant = Registrant.find(domain.registrant_id_was)
@old_registrant = Registrant.find(@domain.registrant_id_was)
@verification_url = "#{ENV['registrant_url']}/etc/"
@domain = domain
mail(to: @old_registrant.email,
mail(to: @old_registrant.email,
subject: "#{I18n.t(:domain_registrant_update_subject, name: @domain.name)} [#{@domain.name}]")
end
end