Browse Source

Fix for deleted email confirmations

development
Godwin 8 years ago
parent
commit
f8ce4130ca
  1. 4
      app/mailers/user_mailer.rb

4
app/mailers/user_mailer.rb

@ -9,10 +9,12 @@ class UserMailer < ActionMailer::Base
default from: "Bike!Bike! <info@bikebike.org>" default from: "Bike!Bike! <info@bikebike.org>"
def email_confirmation(confirmation) def email_confirmation(confirmation)
@confirmation = EmailConfirmation.find(confirmation) if confirmation.present? @confirmation = EmailConfirmation.find_by_id(confirmation) if confirmation.present?
if @confirmation.present?
I18n.locale = @confirmation.user.locale if @confirmation.user.locale.present? I18n.locale = @confirmation.user.locale if @confirmation.user.locale.present?
mail to: @confirmation.user.named_email, subject: clean_subject(_'email.subject.confirm_email','Please confirm your email address') mail to: @confirmation.user.named_email, subject: clean_subject(_'email.subject.confirm_email','Please confirm your email address')
end end
end
def registration_confirmation(registration) def registration_confirmation(registration)
@registration = ConferenceRegistration.find(registration) if registration.present? @registration = ConferenceRegistration.find(registration) if registration.present?

Loading…
Cancel
Save