Skip to content

Commit

Permalink
Update the from address (#557)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmarcia authored Oct 25, 2018
1 parent b2f33d2 commit 70480cd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/jobs/partner_mailer_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base
default from: "from@example.com"
default from: "info@diaper.app"
layout "mailer"
end
2 changes: 1 addition & 1 deletion app/mailers/distribution_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions app/views/distribution_mailer/partner_mailer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Hi <%= @partner.name %>,
<%= @distribution.inspect %>
<br>
Please find an attached pdf containg details about your distribution.
Please find an attached pdf containing details about your distribution.
</p>
<p>
You can pick up your distribution
You can pick up your distribution on <%= @distribution.issued_at %>.
</p>

0 comments on commit 70480cd

Please sign in to comment.