diff --git a/app/mailers/teacher_mailer.rb b/app/mailers/teacher_mailer.rb index 7757fea4..66135998 100644 --- a/app/mailers/teacher_mailer.rb +++ b/app/mailers/teacher_mailer.rb @@ -12,7 +12,7 @@ def welcome_email(teacher) @teacher = teacher set_body set_recipients - mail to: @recipients, #ActionMailer accepts comma-separated lists of emails + mail to: @recipients, # ActionMailer accepts comma-separated lists of emails cc: CONTACT_EMAIL, subject: email_template.subject end @@ -61,14 +61,13 @@ def email_template @email_template ||= EmailTemplate.find_by(title: action_name.titlecase) end - #renders the email body with the {{parameter}} things + # renders the email body with the {{parameter}} things def set_body @body = Liquid::Template.parse(email_template.body).render(liquid_assigns).html_safe end - #renders the list of recipients with the {{parameter}} things + # renders the list of recipients with the {{parameter}} things def set_recipients @recipients = Liquid::Template.parse(email_template.to).render(liquid_assigns).html_safe end - end diff --git a/db/seed_data.rb b/db/seed_data.rb index deccbc0d..7c8a2a76 100644 --- a/db/seed_data.rb +++ b/db/seed_data.rb @@ -59,9 +59,12 @@ module SeedData DENY_EMAIL3 + @to_field = "{{teacher_email}}, {{teacher_personal_email}}" + def self.emails [ { + to: @to_field, body: @welcome_email, path: "teacher_mailer/welcome_email", locale: nil, @@ -73,6 +76,7 @@ def self.emails subject: "Welcome to The Beauty and Joy of Computing!" }, { + to: @to_field, body: @form_submission, path: "teacher_mailer/form_submission", locale: nil, @@ -84,6 +88,7 @@ def self.emails subject: "Form Submission" }, { + to: @to_field, body: @deny_email, path: "teacher_mailer/deny_email", locale: nil, @@ -95,6 +100,7 @@ def self.emails subject: "Deny Email" }, { + to: @to_field, body: @basic_email_with_reason, path: "teacher_mailer/request_info_email", locale: nil,