Skip to content

verifyUserEmails option + mailgun #1219

Closed
@goggelj

Description

@goggelj

My index.js looks like this:

var ParseServer = require('parse-server').ParseServer;
var path = require('path');
var SimpleMailgunAdapter = require('parse-server/lib/Adapters/Email/SimpleMailgunAdapter');
var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI;
if (!databaseUri) {
  console.log('DATABASE_URI not specified, falling back to localhost.');
}

  var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAppId',
  masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
  serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',  // Don't forget to change to https if needed
  liveQuery: {
    classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
  },
  verifyUserEmails: true, 
  emailAdapter: new SimpleMailgunAdapter({
    apiKey: 'my key',
    domain: 'mg.my.domain',
    fromAddress: '[email protected]'
  })
});

However, the line verifyUserEmails breaks the App. If I replace it with verifyUsersEmails, the app builds successfully and I can interact with it (curl, rest, and connect my ios app to it. However, no emails are sent.

My Parse app resides in a folder called 'parse-server'. I am not sure how it looks in heroku. To be precise, I am not sure if my mail adapter loads correctly

Looking at #583 it should be verifyUserEmails.

If it is verifyUserEmails then why does it break my app?
If it is verifyUsersEmails, then why no emails are sent?

As an FYI:

  • I have copied the lib folder from a clone I made of master about a week ago. Could not find the lib folder in current master.
  • tried to replicate this solution:

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

The following Config Vars are defined in Heroku:
APP_ID
MASTER_KEY
MONGOLAB_URI
PARSE_SERVER_REST_API_KEY
PARSE_SERVER_CLIENT_KEY

Steps to reproduce

  1. Cloned parse-server-example into ~/heroku/parse-server
  2. Cloned parse master
  3. Copied lib from master to ~/heroku/parse-server
  4. Edited index.js as per above
  5. Registered user from my ios app
  6. Verified that user appears in mlab but not in main parse database (what I am trying to move away from)

Logs/Trace

On success:
2016-03-28T00:24:13.808887+00:00 app[web.1]: parse-server-example running on port .

On crash I just get an H10 error with little meaningful info. After I enabled 'verbose' logging on Heroku, I got this:

/app/node_modules/parse-server/lib/Config.js:103
2016-03-28T00:51:12.991235+00:00 app[web.1]: throw 'An app name is required when using email verification.';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions