# Email Invitations for Multiple Applications

**URL:** <https://community.auth0.com/t/email-invitations-for-multiple-applications/82385>\
**Category:** Get Help\
**Created:** [April 26, 2022, 5:46am UTC](https://community.auth0.com/t/email-invitations-for-multiple-applications/82385 "2022-04-26T05:46:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avb](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/avb/32/33426_2.png) [@Avb](https://community.auth0.com/u/Avb)\
**Post date:** [April 26, 2022, 5:46am UTC](https://community.auth0.com/t/email-invitations-for-multiple-applications/82385/1 "2022-04-26T05:46:55Z")

</div>

Hello, Auth0 community!

We are implementing email invitations for application signups following the solution provided in the thread [Sending Email Invitations For Application Signup](https://community.auth0.com/t/sending-email-invitations-for-application-signup/57326/3).

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.

```javascript
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? 🤔

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 27, 2022, 4:04pm UTC](https://community.auth0.com/t/email-invitations-for-multiple-applications/82385/3 "2022-04-27T16:04:09Z")

</div>

Hi @Avb,

Welcome to the Auth0 Community!

Are you seeing any errors with this? Also, can you confirm the _type of connection_ (auth0 database, google, facebook, etc.? Also please share the type of hook you are using.

---

<div class="post-metadata">

**Author:** ![Avb](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/avb/32/33426_2.png) [@Avb](https://community.auth0.com/u/Avb)\
**Post date:** [April 28, 2022, 6:25am UTC](https://community.auth0.com/t/email-invitations-for-multiple-applications/82385/4 "2022-04-28T06:25:28Z")

</div>

Thanks for the reply, @dan.woda ,

We use two connections, both of type auth0 database, as well as a _Post User Registration_ hook.

Further investigations in the logs revealed a _Failed Change Password Request_, with description _“connection is disabled”_.

We used the client ID of the wrong application, which is connected only to one of the connections. That’s what you get when naming the applications similar names 🥴

We updated the client ID and things started working immediately 🙌.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 28, 2022, 3:06pm UTC](https://community.auth0.com/t/email-invitations-for-multiple-applications/82385/5 "2022-04-28T15:06:28Z")

</div>

Thanks for the update @Avb!

You certainly aren’t the first person to run into a mysterious issue that ends up as a typo!

I’m going to mark this resolved. Please feel free to open a new topic if you run into anything else!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 28, 2022, 10:30pm UTC](https://community.auth0.com/t/email-invitations-for-multiple-applications/82385/6 "2022-06-28T22:30:44Z")

</div>


