Hi, is there any way to specify a smtp username for email delivery config for email/password recipe?
l
Hi, is there any way to specify a smtp username for email delivery config for email/password recipe?
r
Hey! Yea. There is. One moment.
If you see the above link, it has a config for from -> name. That’s the name that can be shown against the email you are sending from.
Is this what you meant?
l
But this is the name displayed to the customer, right?
r
Yes.
It’s not the customer’s name. Just to clarify
It’s the name of the email you are sending from
l
I need to provide username / password to login to my smtp. The username is different to the sender email id
I am using AWS Simple email service
r
oh i see. Then you can override how the email is sent like this (i assume you use node):
Copy code
ts
EmailPassword.init({
    emailDelivery: {
        override: (oI) => {
            return {
                ...oI,
                sendEmail: async function(input) {
                    // default email templates are here: https://github.com/supertokens/email-sms-templates
                    if (input.type === "PASSWORD_RESET") {
                        // send password reset email.
                    } else {
                        // send email verification email
                    }
                }
            }
        }
    }
})
Essentially you will have to send the emails yourself and this provides maximum flexibility. You can also open an issue on our github about missing username field in smtp settings if you like.
l
Ok, i will try this, thanks.
r
great. https://github.com/supertokens/email-sms-templates contains the email templates for the ones we have by default. So feel free to use those, or make your own templates.
l
I already created my own templates.
r
ah ok fair.