Is it possible to have "Enable EMail Confirmations...
# help
l
Is it possible to have "Enable EMail Confirmations" -> ON but sending custom EMails with links i generate with generateLink() ?
n
Hello @logemann! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
c
unfortunately, not out of the box, see: https://github.com/supabase/gotrue/issues/304
n
Logemann (2022-05-04)
c
one workaround which is quite hacky is to:
- setup an smtp server in the dashboard which sends email to the void (e.g. Ethereral). That way, the emails sent by Supabase will NOT reach the user - Define a trigger which listens for the addition of new users - In the trigger, hand-craft the confirmation link. I say that you will need to hand craft it since you will NOT be able to call generate_link in the trigger - the problem is that the trigger fires BEFORE the transaction is complete and since the transaction is NOT complete, the GoTrue server does NOT see the new user and will tell you 400 or 404 since it thinks that the user does NOT exist. By hand-craft I mean to see what hte link looks like and just put it together with token for the new user (you have it in the NEW record in the trigger)
if anyone can think of another less hacky workaround I would be happy to hear it
l
thanks for your explanation. I can easily call generateLink() on my client after signupUser() was successfull i assume or? But in general this is really something supabase needs to work on. No real saas system can live with those template emails where you just alter the text. This can only be ok for prototyping phase
c
"I can easily call generateLink() on my client after signupUser() was successfull i assume or" - yes, if you have the option to wait for the signupUser() call to complete (i.e. wait for the transaction to complete), then you can use generateLink(). But you still need to setup the SMTP config in the dashboard to send the emails into the void
l
yeah... that was a good tip. Thanks for that. Lets see how to do that.... did you setup your own void emailserver for that? Or is there a service one could use?
there exists a network sniffer with the same name 🙂
works like a charm btw