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
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
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
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
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

Other popular topics Top

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
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
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement