Giter VIP home page Giter VIP logo

Comments (4)

sebsylvester avatar sebsylvester commented on June 15, 2024

Without any code to review, there's not much I can do.
I suggest you use a tool like node-inspector, and set a breakpoint at the line of code that triggers the signup action, and follow the call stack.

from parse-server-mailgun.

mikall avatar mikall commented on June 15, 2024

Thank you Sebastian,
I'll try, in the meanwhile here is my index.js

`var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var path = require('path');
var S3Adapter = require('parse-server').S3Adapter;
var databaseUri = process.env.DATABASE_URI || 'mongodb://mydbconnection';
if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}

var api = new ParseServer({
    databaseURI: databaseUri,
    cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
    appId: process.env.APP_ID || 'myAppId',
    masterKey: process.env.MASTER_KEY || 'myMasterKey', //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
    allowClientClassCreation: false, //process.env.ALLOW_CLIENT_CLASS_CREATION,
    enableAnonymousUsers: false, //process.env.ENABLE_ANONYMOUS_USERS,
    //facebookAppIds: process.env.FACEBOOK_APP_IDS,
    //oauth: process.env.OAUTH,
    //sessionLength: process.env.SESSION_LENGTH,
    //emailVerifyTokenValidityDuration: process.env.EMAIL_VERIFY_TOKEN_VALIDITY_DURATION,

    verifyUserEmails: true,
    revokeSessionOnPasswordReset: true,
    publicServerURL: 'https://replave.com',
    appName: 'Replave DEV',

    //S3 Adapter
    filesAdapter: new S3Adapter(
        process.env.AWS_ACCESS_KEY_ID || 'myS3Id',
        process.env.AWS_SECRET_ACCESS_KEY || 'myS3Key',
        process.env.BUCKET_NAME || 'myS3Bucket' 
    ),

    //Simple email adapter
    emailAdapter: {
            module: 'parse-server-simple-mailgun-adapter',
            options: {
            // The address that your emails come from
            fromAddress: '[email protected]',
            // Your domain from mailgun.com
            domain: 'replave.com',
            // Your API key from mailgun.com    });
            apiKey: 'mykey',
            }   // Client-keys like the javascript key or the .NET key are not necessary with parse-server
    }   // If you wish you require them, you can set them as options in the initialization above:
    // javascriptKey, restAPIKey, dotNetKey, clientKey

    //Complex email adapter
    /*emailAdapter: {
        module: 'parse-server-mailgun',
        options: {
            fromAddress: 'Replave <[email protected]>',
            domain: 'replave.com',
            apiKey: 'myKey',
            templates: {
              passwordResetEmail: {
                subject: 'Reset your password',
                pathPlainText: resolve(__dirname, '/root/replave6/templates/password_reset_email.txt'), 
                pathHtml: resolve(__dirname, '/root/replave6/templates/password_reset_email.html'),
                callback: (user) => { return { firstName: user.get('firstName') }}
              },
              verificationEmail: {
                subject: 'Confirm your account',
                pathPlainText: resolve(__dirname, '/root/replave6/templates/verification_email.txt'),
                pathHtml: resolve(__dirname, '/root/replave6/templates/verification_email.html'),
                callback: (user) => { return { firstName: user.get('firstName') }}
              },
              customEmailAlert: {
                subject: 'Urgent notification!',
                pathPlainText: resolve(__dirname, '/root/replave6/templates/custom_alert.txt'),
                pathHtml: resolve(__dirname, '/root/replave6/templates/custom_alert.html'),
                callback: (user) => { return { firstName: user.get('firstName') }}
              }
            }
        }
    }*/
    //END COMPLEX EMAIL MODULE
});

var app = express();

// Serve static assets from the /public folder
//app.use('/public', express.static(path.join(__dirname, '/public')));

// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);

// Parse Server plays nicely with the rest of your web routes
//app.get('/', function(req, res) {
//  res.status(200).send('I dream of being a website.  Please star the parse-server repo on GitHub!');
//});

app.get('/', function(req,res) {
    res.status(200).send('Replave dev env works');
});

// There will be a test page available on the /test path of your server url
// Remove this before launching your app
app.get('/test', function(req, res) {
    res.status(200).send('It Works!');
});

var port = process.env.PORT || 80;
var httpServer = require('http').createServer(app);
    httpServer.listen(port, function() {
    console.log('Replave DEV running on port ' + port + '.');
});`

Thank you,
Michele

from parse-server-mailgun.

sebsylvester avatar sebsylvester commented on June 15, 2024

Your setup looks ok, except that the commented out email adapter section still uses the resolve function directly instead of path.resolve.

I don't think it's a problem with the parse-server-mailgun module. Perhaps something is wrong with the code in you app that creates the User object. Are you sure that the new user is actually created? Otherwise the Parse Server will not use the Mailgun adapter.

from parse-server-mailgun.

mikall avatar mikall commented on June 15, 2024

Hi,
we can close this issue, it was related to a network behaviour (firewall/proxy) and not to parse server or to your mailgun module.
Thank you for your help, it works perfectly now.

from parse-server-mailgun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.