add MAILGUN_BASE_URI - #2935
Merged
Merged
Conversation
BundleMonUnchanged files (7)
No change in files bundle size Final result: ✅ View report in BundleMon website ➡️ |
ruslandoga
commented
May 17, 2023
|
|
||
| if mailgun_base_uri = get_var_from_path_or_env(config_dir, "MAILGUN_BASE_URI") do | ||
| config :plausible, Plausible.Mailer, base_uri: mailgun_base_uri | ||
| end |
Contributor
Author
There was a problem hiding this comment.
I'm doing it this way because the alternatives either don't work:
config :plausible, Plausible.Mailer,
adapter: Bamboo.MailgunAdapter,
hackney_opts: [recv_timeout: :timer.seconds(10)],
api_key: get_var_from_path_or_env(config_dir, "MAILGUN_API_KEY"),
domain: get_var_from_path_or_env(config_dir, "MAILGUN_DOMAIN"),
# if MAILGUN_BASE_URI is not set, `base_uri: nil` and it causes a runtime error during delivery
# https://github.com/thoughtbot/bamboo/blob/53bd3929da6778ccf4ec7817070ec19f2b12b772/lib/bamboo/adapters/mailgun_adapter.ex#L63-L65
# it would've worked if base_uri used `Application.get_env(:bamboo, :base_uri) || @default_base_uri` instead.
base_uri: get_var_from_path_or_env(config_dir, "MAILGUN_BASE_URI")Or require more maintenance:
config :plausible, Plausible.Mailer,
adapter: Bamboo.MailgunAdapter,
hackney_opts: [recv_timeout: :timer.seconds(10)],
api_key: get_var_from_path_or_env(config_dir, "MAILGUN_API_KEY"),
domain: get_var_from_path_or_env(config_dir, "MAILGUN_DOMAIN"),
# this works now but would require us to keep an eye on newer api version and keep it up to date
base_uri: get_var_from_path_or_env(config_dir, "MAILGUN_BASE_URI", "https://api.mailgun.net/v3")|
Thank you for this work. I started working on a similar PR until I saw this one. So I've written some docs for this PR and sent out a PR for the docs side plausible/docs#396 |
Contributor
Author
|
@tenfourty thank you! |
ukutaht
approved these changes
May 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This PR adds
MAILGUN_BASE_URIsupport as suggested in #2649 (comment)Tests
Changelog
Documentation
Dark mode