Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignUp sending email template with empty parameters #14

Closed
fplaras opened this issue Dec 24, 2021 · 7 comments
Closed

SignUp sending email template with empty parameters #14

fplaras opened this issue Dec 24, 2021 · 7 comments

Comments

@fplaras
Copy link

fplaras commented Dec 24, 2021

I was attempting to signup a user but the email template provided by supabase for confirmation has parameters that are not clear how they can be set or created. For example {{ .FullName }}. Anyone can steer me in the right direction? I have used other methods such as CreateUser as an alternative but it doesn't not trigger an email confirmation to be sent and I could not find a method to trigger an email confirmation request via the client.

@acupofjose
Copy link
Contributor

@fplaras thanks for the question!

Have you followed everything here?

https://supabase.com/docs/reference/javascript/auth-signup (these are the JS docs but they mostly translate).

For the C# Gotrue client, you can add the metadata with the CreateUser method and a service role key. But it looks like I’m missing that user data option on the gotrue SignUp call, so I can add that in!

@fplaras
Copy link
Author

fplaras commented Dec 24, 2021

I did see that there was an optional object parameter in CreateUser that needed to be eventually a dictionary of <string,object>. I thought it was what I needed to use but I might have had the wrong syntax if it was FullName, full_name or fullName.

The SignUp() method did fire the email confirmation and the configurl parameter is working but I updated the link of that template to redirect to an api controller route but I have to map the query string from the Url to the signature of the controller so that it can be a valid route. The goal I was aiming for was to update some user fields in one of my tables when the email is verified by the user.

@acupofjose
Copy link
Contributor

@fplaras To update some fields, you might be able to make a Postgresql trigger that listens for changes on the Table field: auth.users.confirmed_at. But, you would likely have better luck getting feedback on the discord for something like that!

@acupofjose
Copy link
Contributor

The requested change to SignUp signature is in [email protected] - I'll include it in the next release for supabase-csharp

@fplaras
Copy link
Author

fplaras commented Dec 24, 2021

Thank you, this is the snippet of code I have. It is not sending an email confirmation when the user is created and the required email confirmation flag is set on the dashboard. The user does get created.
var response= await _client.Auth.CreateUser(configuration["Supabase:SecretKey"],email,password,new { FullName = "Name" });

@acupofjose
Copy link
Contributor

@fplaras I don't believe the CreateUser call actually triggers an email send - the new SignUp function is included in 0.2.10 - please use that! It's being published momentarily.

@fplaras
Copy link
Author

fplaras commented Dec 24, 2021

@fplaras I don't believe the CreateUser call actually triggers an email send - the new SignUp function is included in 0.2.10 - please use that! It's being published momentarily.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants