[BREAKING CHANGE] v0.3.3: MiddlewareType and WriteToSkipMiddleware
This release will break current Middleware implementations
For middlewares to be able to access the fully written mail message, we need a way to execute WriteTo
without the calling middleware to be handled, otherwise we end up in an infinite loop.
This release introduces the MiddlewareType
and the corresponding change of the Middleware
interface. We now require to return the MiddlewareType
when the Type()
method on the interface is called. Conveniently MiddlewareType
is an alias to a string
.
This way we can also introduce the WriteToSkipMiddleware()
method which takes a MiddlewareType
as argument. This will allow us to use a WriteTo
call with the initiating Middleware
itself to be skipped.
Please note: This release will break any existing go-mail Middleware
, since they don't provide a Type()
method yet.
What's Changed
Full Changelog: v0.3.2...v0.3.3