Working on:
linjunpop / bamboo_sendcloud Goto Github PK
View Code? Open in Web Editor NEW๐ A Sendcloud adapter for the Bamboo.
Home Page: https://hex.pm/packages/bamboo_sendcloud
License: MIT License
๐ A Sendcloud adapter for the Bamboo.
Home Page: https://hex.pm/packages/bamboo_sendcloud
License: MIT License
Working on:
๐ Hi Jun Lin,
Thanks for maintaining this Bamboo adapter. ๐ฅณ
There will be a breaking change coming to Bamboo in v2.0.0 where the deliver_now
function will no longer raise an error on failure to deliver an email. Instead, it will return :ok
or :error
tuples. That way, users of the library can decide how to handle the errors. I've completed that work in beam-community/bamboo#571.
I've also added a deliver_now!
function that is meant to behave exactly as deliver_now
currently behaves. So, there's an easy upgrade path for users who don't want to handle their own errors. They can change deliver_now
-> deliver_now!
.
(There are also deliver_later
corresponding changes, but from the adapter's perspective, I don't know that it matters).
In order for people to upgrade to Bamboo v2.0.0, the adapters will need to stop raising errors when they fail to deliver emails. In order to accommodate that, the adapter's callbacks are changing like this:
- @callback deliver(%Bamboo.Email{}, %{}) :: any
+ @callback deliver(%Bamboo.Email{}, %{}) :: {:ok, any} | {:error, Exception.t() | String.t()}
In other words, adapters should now return an {:ok, response}
tuple or an {:error, error}
tuple, where the error is either an exception struct that can later be raised or an error message.
To facilitate that work, PR 571 also introduces a Bamboo.ApiError.build_api_error
function that can be used by adapters โ if you want to easily build an error to return in the {:error, error}
response.
I have already done some changes to the Sendgrid, Mailgun, and Mandrill adapters. They might serve as a guide:
I wanted to open this issue for two reasons:
Unfortunately, I can't offer to open PRs to make the changes in all the adapter repos, but if it's helpful, I'd be happy to review PRs.
And if there's some change to Bamboo that would make it easier to work with your adapter, or if you have suggestions or comments on PR 571, I'd love to know.
Thanks again for maintaining this adapter, and please feel free to close this issue whenever you've read it (if it's of no further use). It just seemed like the easiest way to communicate about the upcoming changes with you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.