Hello, Auth0 community!
We are implementing email invitations for application signups following the solution provided in the thread Sending Email Invitations For Application Signup.
Our scenario includes two database connections, used with two distinct applications. The only difference from the provided answer is accessing the connection object for the connection name connection: context.connection.name
.
The invites are sent from one of the applications.
module.exports = function (user, context, cb) {
var auth0 = require('auth0@2.32.0');
var authClient = new auth0.AuthenticationClient({
domain: 'example-connections.us.auth0.com',
clientId: 'YOUR_APP_CLIENT_ID',
clientSecret: 'YOUR_APP_CLIENT_SECRET',
});
var userAndConnection = {
email: user.email,
connection: context.connection.name,
connection_id: context.connection.id,
};
authClient.requestChangePasswordEmail(userAndConnection, function(err){
cb(null, user, context);
});
};
This works like a charm for one of the connections, but we don’t seem to receive any emails for the other.
We have logged the Hook functionality and confirmed that the connection name is correct.
Are there some other configurations we might have forgotten?