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

Dynamic sendgrid key #523

Merged
merged 5 commits into from
Aug 24, 2020
Merged

Conversation

spunkedy
Copy link
Contributor

Fixes #522

Copy link
Contributor

@maymillerricci maymillerricci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @spunkedy -- it looks great overall! Just a couple small questions.

lib/bamboo/adapters/send_grid_adapter.ex Outdated Show resolved Hide resolved
test/lib/bamboo/adapters/send_grid_adapter_test.exs Outdated Show resolved Hide resolved
Copy link
Collaborator

@germsvel germsvel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spunkedy thanks so much for coming back and making those fixes! I left a couple more comments. If you have the time, I'd love to get those addressed and merge this in. If you don't have the time, let me know. We can get this in, and I can fix those things after.

lib/bamboo/adapters/send_grid_adapter.ex Outdated Show resolved Hide resolved
api_key: "my_api_key"
# or {:system, "SENDGRID_API_KEY"},
# or {ModuleName, :method_name, []}
# or &ModuleName.method_name/0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the discussion in #523 (comment), and I saw that you removed the anonymous function in 61409d3 (thank you!).

Is &ModuleName.method_name/0 technically an anonymous function as well? Doesn't the capture operator create an anonymous function? Do you know if this will work or should we remove it as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is an anonymous function. and looking back at the the driving factor behind this, https://hexdocs.pm/stripity_stripe/readme.html#configuration

uses the anonymous function. It's syntaxtual at this point, so I don't mind just the first 2

I have been using

config :notification, Notification.Mailer,
  adapter: Bamboo.SendGridAdapter,
  api_key: {Notification.Secrets, :sendgrid_secret, []},
  hackney_opts: [
    recv_timeout: :timer.minutes(1)
  ]

for a while now without issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be updated now

@germsvel germsvel merged commit 4d20168 into beam-community:master Aug 24, 2020
@germsvel
Copy link
Collaborator

Thank you so much @spunkedy!! I really appreciate coming back and updating all of this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Advanced API key definitions for sendgrid.
4 participants