Search code examples
herokumailgunparse-serverpassword-recovery

Password-Reset / Parse-Server


I just moved an app from Parse.com to Parse-Server. It has users and I have an issue to send password-reset mails. I am getting this message:

enter image description here

I read on the net that I need to change index.js. But I have no index.js at this point. So what do I need to do to make the password-reset mails work? I already have an account on MailGun, which is needed as far as I have read, to solve this issue.


Solution

  • in order to support Password reset you need to define an email adapter inside your index.js file. index.js file is located under the root folder of your parse-server project. the index.js is the file where ParseServer is being initialized. The email adapters which are currently supported by parse-server are sendgrid and mailgun

    Adding email adapter is pretty simple:

    1. Install the relevant email adapter module. Enter npm install {email_module_name} --save in your parse-server project folder
    2. Open index.js file and go to where ParseServer is being initalized and add the property verifyUserEmails: true
    3. Add emailAdapter also the where ParseServer is being initialized

        emailAdapter: {
            module: 'parse-server-simple-mailgun-adapter',
            options: {
              // The address that your emails come from
              fromAddress: '[email protected]',
              // Your domain from mailgun.com
              domain: 'example.com',
              // Your API key from mailgun.com
              apiKey: 'key-mykey',
            }