# 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:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [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/1 "2022-05-20T07:16:56Z")

</div>

How to Send Email Invitations for Application Signup for Social accounts such as gmail email? I can do it when a user is in the Auth0 database but the requirement is that Send Email Invitations for Application Signup to existing google accounts.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [May 24, 2022, 12:08am UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/3 "2022-05-24T00:08:08Z")

</div>

Hi @dev40 ,

Welcome to the Auth0 Community!

The “Send Email Invitation for Application Signup” is for the Auth0 database. The invitation basically is a change password link. For Social accounts, the social channel is the IdP, so we can not update password. Could you please share some context regarding why you only want to send email invitation for application signup for Google accounts?

One possible solution for your use case is to set up Account Linking, where users link their Auth0 database accounts with their Google Account. [This](https://community.auth0.com/t/how-to-use-the-auth0-account-link-extension-to-link-accounts/81196/2) article explains how to use the Auth0 Account linking extension, and [this](https://community.auth0.com/t/how-to-implement-client-side-user-initiated-account-linking/81199/2) article explains how to implement client-side Account linking.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [May 26, 2022, 3:50am UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/4 "2022-05-26T03:50:26Z")

</div>

Hi @lihua.zhang ,

For now we will only allow google emails but later we will allow any social accounts like facebook accounts for registration and login. We have an app that the users can login using their account registered in Auth0. We will not be using the Auth0 database because we want to utilize the social feature. The use case is that we will send users an invitation link then from that they will be registered in Auth0 having connection like google-oauth2.

We also preferred not to make the user change password because they might be annoyed. We just want them to be invited and registered in Auth0.

Any further recommendation from this?

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [May 26, 2022, 1:20pm UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/5 "2022-05-26T13:20:38Z")

</div>

Hi @dev40

First, be aware that you cannot do “invite only” with social. Any social user can sign up for your app, whether they receive an invitation or not.

Social users are “created” in Auth0 by logging in. So you can just send the users a link that redirects them to the login page. Then they will log in with their social credentials, be redirected back to the app and have an account.

The “login page” should be in your app and use javascript to automatically kick off the login process.

John

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [May 29, 2022, 11:59pm UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/6 "2022-05-29T23:59:51Z")

</div>

@john.gateley This is basically my solution right now. Thank you.

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 2, 2022, 7:12am UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/7 "2022-06-02T07:12:31Z")

</div>

@lihua.zhang @john.gateley we change our process flow and we are implementing linking between account in Auth0 DB and google. We try to login using google account then perform linking. But after this the Authorization token generated by /oauth/token became invalid. We cannot even refresh it. Even the Code retrieved to be used to get authorization token became invalid. We want to access our APP immediately after registration and linking without prompting the user to login again after linking. Can we do this or the user really needs to login again?

Can we get Authorization token without user action?

---

<div class="post-metadata">

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

</div>

any updates for this concern @lihua.zhang @john.gateley ?

---

<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!

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 7, 2022, 7:31am UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/10 "2022-06-07T07:31:00Z")

</div>

@gparascandolo where do I get primaryUser and how do I know what type of object and what properties of the primaryUser?

After setting it, why do I need to return the primary user? I am setting the account in Auth0 DB as the primary

---

<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 7, 2022, 7:31pm UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/11 "2022-06-07T19:31:48Z")

</div>

@dev40 Sorry, maybe I misunderstood your previous comment. You said you implemented linking between the Auth0 DB and Google account, correct? How are you doing this now?

Are you using the Auth0 Account linking extension mentioned above or a client-side method? Or are you doing it server-side with the Auth0 Management API to account link?

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 8, 2022, 12:44am UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/12 "2022-06-08T00:44:27Z")

</div>

@gparascandolo I am using Auth0 Management API to account link.

Is it also ok if I just set the primary account to the newly registered social account? It seems to fix my issue.

---

<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 8, 2022, 2:05pm UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/13 "2022-06-08T14:05:44Z")

</div>

@dev40 Yes, you can set the primary account to the newly registered social account.

Be aware that if you do this, you will lose the original `user_metadata` and `app_metadata` properties of the Auth0 DB account. Make sure to copy or merge important metadata to the newly registered social account before Account Linking.

Please see the notes in this section of the documents for other things to consider too  
(for example, the secondary profile is removed from the user list too):  
[https://auth0.com/docs/manage-users/user-accounts/user-account-linking#how-it-works](https://auth0.com/docs/manage-users/user-accounts/user-account-linking#how-it-works)

Also be aware that if you need to update `email`, `email_verified`, `phone_number`, `phone_verified`, `username` or `password` of the secondary Auth0 DB account in the future via the PATCH [/api/v2/users/{id}](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id) endpoint, you need to also specify the `connection` in the API requests.

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 9, 2022, 12:39am UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/14 "2022-06-09T00:39:25Z")

</div>

@gparascandolo noted , I believe that most users will use their social accounts to login.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 29, 2022, 9:16pm UTC](https://community.auth0.com/t/how-to-send-email-invitations-for-application-signup-for-social-accounts-such-as-gmail-email/83786/15 "2022-09-29T21:16:20Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
