Skip to content

Commit

Permalink
Fix how emails are pulled before sending
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabyalter committed Jul 8, 2019
1 parent 1f99a5c commit 3721c7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/mailers/registration_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ class RegistrationMailer < ActionMailer::Base

def registration_email(user)
@user_data = user
emails = registration_emails.collect { |email| email["email"] }
emails = registration_emails
mail(to: emails, cc: @user_data.email, subject: t('send_email.subject')) if emails.present?
end

private
def registration_emails
(ENV['REGISTRATION_EMAILS']&.split('::')&.map {|e| e.split(':').last } || [])
(ENV['REGISTRATION_EMAILS']&.split('::')&.map {|e| e.split(':').first } || [])
end
end

0 comments on commit 3721c7f

Please sign in to comment.