Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the from address #557

Merged
merged 1 commit into from
Oct 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>