Swoosh - Email client

Hi all,

Looks like the original authors of Swoosh never posted it here.
I just released Swoosh 1.1.0, and here I am.

1.1 adds Recipient Protocol with @derive

The Recipient Protocol enables you to easily make your structs compatible with Swoosh functions.

defmodule MyUser do
  @derive {Swoosh.Email.Recipient, name: :name, address: :email}
  defstruct [:name, :email, :other_props]
end

Now you can directly pass %MyUser{} to from , to , cc , bcc , etc. See Swoosh.Email.Recipient for more details.

https://hexdocs.pm/swoosh/Swoosh.Email.Recipient.html

Po Chen

6 Likes

Grats on the release.

1 Like

Swoosh 1.4 released with a built-in Finch-based API client. (it has always had a hackney-based one)

Now you can pick either hackney or finch.

If you implement a custom API client, you can use anything else :slight_smile:

6 Likes

Neat! I saw it the other day but I saw it was hardcoded to Swoosh.Finch, wasn’t aware that I can switch it.

By the way slightly unrelated, are we typically meant to start a new Finch instance for every endpoint we connect to for the performance?

Not really. A Finch instance can handle multiple pools. Unless message passing is becoming the bottleneck (not likely), you shouldn’t have to start multiple of them.

From Finch documentation:

  {Finch,
   name: MyConfiguredFinch,
   pools: %{
     :default => [size: 10],
     "https://hex.pm" => [size: 32, count: 8]
   }}
3 Likes

Thanks I missed that out in the documentation, I thought there is only one pool per instance but looks like Finch can start multiple per host, that’s awesome!

Great work! :hugs:

2 Likes

image
Unlocked 1k achievement today. :partying_face:

7 Likes

1.5 released with Telemetry support.

5 Likes

1.6 released a few days ago.

:sparkles: Features

allow custom CIDs for inline attachments @taobojlen (#665)
add OhMySMTP adapter @taobojlen (#663)

And a ton of documentation updates.

2 Likes