-
Notifications
You must be signed in to change notification settings - Fork 86
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
Switch to SparkPost #1332
Switch to SparkPost #1332
Conversation
recipients: [%{name: user.first_name, email: user.email}], | ||
substitution_data: %{ | ||
from_name: "Code Corps", | ||
from_email: "[email protected]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are identical everywhere, as far as I can tell, so maybe we add a helper module which builds the base model. I wouldn't stress about it yet, though.
with %StripeConnectCharge{user: %User{} = user} = charge <- Repo.preload(charge, :user), | ||
%Project{} = project <- invoice.subscription |> get_project(), | ||
{:ok, %DonationGoal{} = current_donation_goal} <- project |> get_current_donation_goal() | ||
do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The email building can fail. I think this should go to the event handler. Data should be fetched/preloaded there.
lib/code_corps/sparkpost/tasks.ex
Outdated
defp load_css_file() do | ||
File.cwd! |> Path.join("emails") |> Path.join("styles.css") |> File.read! | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is probably a dialyzer nightmare right now. Need to clean it up
|> (fn list -> list -- @reserved_keys end).() | ||
|> Enum.concat(@global_keys) | ||
|> Enum.sort | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a perfect helper, but should be helfpul
Setup basic API usage and testing infrastructure
fde52e1
to
ad53de0
Compare
14dd68d
to
93e3c00
Compare
93e3c00
to
39d3541
Compare
e9f1961
to
9cc8beb
Compare
7b8798b
to
997479b
Compare
e075407
to
6d6cc63
Compare
What's in this PR?
Things to do in this PR:
CodeCorps.Emails
References
Fixes #1331
Issues to add before merge
CodeCorps.Emails.Transmissions.Receipt
- all with failure points should go into the event handler performing the email send.Receipt.build
should not have a failure point. - Clean up CodeCorps.Emails.Transmissions.Receipt #1337