amsub24
amsub24

Reputation: 145

How do you configure an emailAdapter for parse-server?

I'm trying to test out the password reset flow on a locally running parse-server instance. Every time I send a password reset request I get the following error error: Uncaught internal server error. Trying to send a reset password but no adapter is set undefined. I know I'm supposed to configure the emailAdapter in cli-definitions but I'm not too sure what exactly I'm supposed to put there. I tried changing the contructor in ParseServer.js to have

    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',
    }
  }

but that did not work. Any help is greatly appreciated!

Upvotes: 5

Views: 2754

Answers (1)

James Greenhalgh
James Greenhalgh

Reputation: 96

Just got this configured myself and I think you may just be missing a few parameters.

In the configuration in your index.js or other file where ParseServer is being initialized, you need all of the following:

 verifyUserEmails: true,
 // Same as the SERVER_URL used to configure ParseServer, in my case it uses Heroku
 publicServerURL: 'http://MY_HEROKU_APP.herokuapp.com/parse', 
 appName: 'MY_APP',
 emailAdapter: {
    module: 'parse-server-simple-mailgun-adapter',
    options: {
      fromAddress: '[email protected]',
      domain: 'example.com',
      apiKey: 'key-XXXXXX',
    }
 }

Upvotes: 6

Related Questions