From d1fe7512e9473266f585051419e466b50b581243 Mon Sep 17 00:00:00 2001 From: Sean Marcia Date: Wed, 24 Oct 2018 22:28:23 -0400 Subject: [PATCH] Update the from address (#557) --- app/jobs/partner_mailer_job.rb | 2 +- app/mailers/application_mailer.rb | 2 +- app/mailers/distribution_mailer.rb | 2 +- app/views/distribution_mailer/partner_mailer.html.erb | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/jobs/partner_mailer_job.rb b/app/jobs/partner_mailer_job.rb index 0d651cb2d2..f8c5a5671f 100644 --- a/app/jobs/partner_mailer_job.rb +++ b/app/jobs/partner_mailer_job.rb @@ -3,6 +3,6 @@ class PartnerMailerJob workers 2 def perform(current_organization, distribution) - DistributionMailer.partner_mailer(current_organization, distribution) + DistributionMailer.partner_mailer(current_organization, distribution).deliver_now end end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 3c34c8148f..f8f6f804d7 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,4 +1,4 @@ class ApplicationMailer < ActionMailer::Base - default from: "from@example.com" + default from: "info@diaper.app" layout "mailer" end diff --git a/app/mailers/distribution_mailer.rb b/app/mailers/distribution_mailer.rb index 4434e458e2..4ccd96cace 100644 --- a/app/mailers/distribution_mailer.rb +++ b/app/mailers/distribution_mailer.rb @@ -8,6 +8,6 @@ def partner_mailer(current_organization, distribution) @partner = distribution.partner @distribution = distribution attachments[format("%s %s.pdf", @partner.name, @distribution.created_at.strftime("%Y-%m-%d"))] = DistributionPdf.new(current_organization, @distribution).render - mail to: @partner.email + mail(to: @partner.email, from: current_organization.email, subject: "Your Distribution") end end diff --git a/app/views/distribution_mailer/partner_mailer.html.erb b/app/views/distribution_mailer/partner_mailer.html.erb index 8e7f44c9f4..809030355c 100644 --- a/app/views/distribution_mailer/partner_mailer.html.erb +++ b/app/views/distribution_mailer/partner_mailer.html.erb @@ -2,8 +2,8 @@ Hi <%= @partner.name %>, <%= @distribution.inspect %>
- Please find an attached pdf containg details about your distribution. + Please find an attached pdf containing details about your distribution.

- You can pick up your distribution + You can pick up your distribution on <%= @distribution.issued_at %>.