Hello! I'm implementing a custom emailing system. ...
# support-questions-legacy
g
Hello! I'm implementing a custom emailing system. I see that for email verification I can get the email verification link and info using
let { user, emailVerifyLink } = input;
and
let { id, email } = user;
, but how do I get the password reset link in the case when I'm sending a password reset email and
input.type !== "EMAIL_VERIFICATION"
? I'm looking at the page https://supertokens.com/docs/emailpassword/email-delivery/custom-method for reference!
r
hey!
Copy code
ts
EmailPassword.init({

    emailDelivery: {
        override: (originalImplementation) => {
            return {
                ...originalImplementation,
                sendEmail: async function (input) {
                    if (input.type === "EMAIL_VERIFICATION") {
                        let { user, emailVerifyLink } = input;
                        let { id, email } = user;
                        // TODO: create and send email verification email
                    } else {
                        let { passwordResetLink, user } = input;
                        let { id, email } = user;
                        // TODO: create and send password reset email

                        // Or use the original implementation which calls the default service,
                        // or a service that you may have specified in the emailDelivery object.
                        return originalImplementation.sendEmail(input);
                    }
                }
            }
        }
    },
})
g
Hi! This is soooo useful thank you very much, I was missing the
passwordResetLink
!
r
great
2 Views