r4z4

r4z4

Swoosh + SendGrid, do I need some external lib?

Hey all I just have a quick question on setting up Swoosh and the email confirmation. Am I supposed to be bringing in some external lib to use? There is a sendgrid package but it is pretty old and does not seem to be updated. Kind of seems like it is set up out of the box but it just doesn’t work.

Same account works flawlessly in Rust and cURL examples but with Elixir I get an {:ok, _id} response and nothing ever gets sent or no errors reported.
I did notice the difference of the docs having a domain: attribute and most examples I can come across missing it, but none of the other SDKs have it either so I am not sure that is it. I have tried it with both commented out and left in and with various domains too but still just get an ok response and nothing. Of course an error message would be nice but …

I am using a SendGrid account and adapter btw.

In runtime.exs:

      config :ex_chaa, ExChaa.Mailer,
        adapter: Swoosh.Adapters.Sendgrid,
        api_key: System.get_env("SENDGRID_API_KEY")
        # domain: System.get_env("SENDGRID_DOMAIN")

      config :swoosh, :api_client, Swoosh.ApiClient.Finch
  • the minimal alterations to user_notifier.exs to have the emails match.

Just wondering if anyone has come across this or may have any ideas

Is there something else I need to do to have the Mailer ACTUALLY deliver?

Or if anyone has any suggestions for solutions that actually work or alternatives to Swoosh if that is the issue.

Thanks all!

First Post!

dimitarvp

dimitarvp

I would be extremely surprised if SendGrid through Swoosh is not working.

  1. Have you made it work in dev env? (namely not through runtime.exs)
  2. Have you tried a different API client?

Last Post!

jswanner

jswanner

Yeah, I have that in my runtime config

As for guides, I’m not sure of any official, comprehensive guides; there are lots of permutations of how it can be set up, depending on the email provider, and the API client (if needed).

The individual pieces have documentation: Swoosh.ApiClient.Finch — Swoosh v1.26.2 and Swoosh.Adapters.Sendgrid — Swoosh v1.26.2

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54921 245
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement