# How to Send Email Invitations for Application Signup for Social accounts such as gmail email?

**URL:** <https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786>\
**Category:** Get Help\
**Created:** [May 20, 2022, 7:16am UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786 "2022-05-20T07:16:56Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![gparascandolo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gparascandolo/32/38788_2.png) [@gparascandolo](https://community.auth0.com/u/gparascandolo)\
**Post date:** [June 6, 2022, 5:53pm UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/9 "2022-06-06T17:53:21Z")

</div>

@dev40 I’ll link to a previous comment I made regarding a question for Account Linking in Auth0 and uninterrupted sessions

> [@Account linking using the management API](https://community.auth0.com/t/account-linking-using-the-management-api/84332/2):
>
> It depends on which account you are setting as the primary user vs secondary user. If the user signs up with their Facebook account and it is set as the primary user during account linking, the user should remain logged in as the new facebook account they just signed up with. If the user signs up with their Facebook account, but [abc@gmail.com](mailto:abc@gmail.com) is set as the primary user, you must also set and return [abc@gmail.com](mailto:abc@gmail.com) as the event.user in the Action. This will let the authentication flow continue f…

If you are setting the Auth0 DB account as the primary account when performing linking, you must also set and return the Auth0 DB account as the user in the Auth0 Rule or Action.

If you are using Auth0 Rules, you can do this with the following

```auto
user = primaryUser; 
context.primaryUser = primaryUser.user_id;
return callback(null, user, context);

```

If you are using Auth0 Actions, you can do this with the following

```auto
event.user = primaryUser;
return {
  user: primaryUser
}

```

I hope this helps!

---

_[View the full topic](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786)._
