nhost / hasura-backend-plus

🔑Auth and 📦Storage for Hasura. The quickest way to get Auth and Storage working for your next app based on Hasura.
https://nhost.github.io/hasura-backend-plus/
MIT License
1.17k stars 187 forks source link

Add URL formatted action variable for Magic Link for login and register #535

Closed elitan closed 3 years ago

elitan commented 3 years ago

So we don't have to use action.replace(/ /g, '-') in the email templates. But instead something like action_url.

Example:

        await emailClient.send({
          template: 'magic-link',
          message: {
            to: user.email,
            headers: {
              'x-token': {
                prepared: true,
                value: ticket
              }
            }
          },
          locals: {
            display_name,
            token: ticket,
            url: APPLICATION.SERVER_URL,
            action: 'sign up',
            action_url: 'sign-up'
          }
        })