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

Switch to SparkPost #1332

Closed
wants to merge 20 commits into from
Closed

Switch to SparkPost #1332

wants to merge 20 commits into from

Conversation

begedin
Copy link
Contributor

@begedin begedin commented Dec 21, 2017

What's in this PR?

Things to do in this PR:

  • tests for all functions in CodeCorps.Emails
  • couple of remaining dialyzer errors. I'm not sure they're fixable as is. Might need to ignore

References

Fixes #1331

Issues to add before merge

recipients: [%{name: user.first_name, email: user.email}],
substitution_data: %{
from_name: "Code Corps",
from_email: "[email protected]",
Copy link
Contributor Author

@begedin begedin Dec 21, 2017

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
Copy link
Contributor Author

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.

defp load_css_file() do
File.cwd! |> Path.join("emails") |> Path.join("styles.css") |> File.read!
end
end
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@begedin begedin force-pushed the 1331-switch-to-sparkpost branch 4 times, most recently from fde52e1 to ad53de0 Compare December 22, 2017 12:37
@begedin begedin force-pushed the develop branch 18 times, most recently from e075407 to 6d6cc63 Compare February 12, 2018 16:17
@begedin begedin closed this Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Perform switch from Postmark to SparkPost
2 participants