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 Mailgun.deliver to return ok/error tuples #573

Merged
merged 1 commit into from
Feb 19, 2021

Conversation

germsvel
Copy link
Collaborator

Requires: #571

What changed?

Updates Mailgin.deliver function to return ok/error tuples to abide by the new api.

Note on raising configuration errors

We do not change the raising of errors when they deal with configuration options. Those errors are categorically different. We want to return ok/error tuples when there's an error building/delivering email. If a user of Bamboo is missing a configuration variable, it seems important to raise an error.

@germsvel germsvel added adapter Related to supported adapters breaking Potentially breaking change labels Dec 28, 2020
@germsvel germsvel added this to the 2.0 milestone Dec 28, 2020
@lady3bean
Copy link

This one is also failing on a missing build_api_error function, as is #572. Otherwise makes sense building off the other PR for deliver_now! and deliver_later!

== Compilation error in file lib/bamboo/adapters/mailgun_adapter.ex ==
** (CompileError) lib/bamboo/adapters/mailgun_adapter.ex:107: undefined function build_api_error/3
    (elixir) src/elixir_locals.erl:107: :elixir_locals."-ensure_no_undefined_local/3-lc$^0/1-0-"/2
    (elixir) src/elixir_locals.erl:108: anonymous fn/3 in :elixir_locals.ensure_no_undefined_local/3
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6

What changed?
==============

Updates Mailgin.deliver function to return ok/error tuples to abide by
the new api.

Note on raising configuration errors
-----------------------------------

We do not change the raising of errors when they deal with configuration
options. Those errors are categorically different. We want to return
ok/error tuples when there's an error building/delivering email. If
a user of Bamboo is missing a configuration variable, it seems important
to raise an error.
@germsvel germsvel changed the base branch from bamboo-2 to master February 19, 2021 14:30
@germsvel germsvel merged commit 4e7b5fa into master Feb 19, 2021
@germsvel germsvel deleted the gv-mailgun-new-deliver branch February 19, 2021 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapter Related to supported adapters breaking Potentially breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants