Jump to content

Hook to accept User's invite to Account?


steph.hope

Recommended Posts

Is there a way to have the invites to connect a User to an Account automatically approved? Via a hook or anything?

We're needing to import a number of clients from an old system who will have two Users, and don't want to have to explain to the end clients why they have to accept an invitation due to our internal change in process.

Haven't yet done the upgrade to v8 so I haven't been able to poke around myself to find a way, trying to understand the situation before doing the upgrade.

Link to comment
Share on other sites

6 hours ago, steph.hope said:

Is there a way to have the invites to connect a User to an Account automatically approved? Via a hook or anything?

nothing springs to mind...

6 hours ago, steph.hope said:

We're needing to import a number of clients from an old system who will have two Users, and don't want to have to explain to the end clients why they have to accept an invitation due to our internal change in process.

technically, I think you could bypass the invite system with a combination of API and database updating, e.g create the user(s) using the AddUser API and then assign those user(s) to the relevant client(s) by creating a record in the tblusers_clients database table...

fundamentally, I think that's all the invite system does, e.g when an invite is created, a record is added to the tbluser_invites table; if invite accepted, it creates the record in the tblusers_clients table and possibly removes the record from tbluser_invites.

tblusers_clients looks like this...

kqBJi1I.png

  • auth_user_id -> id value in tblusers
  • client_id -> id value in tblclients
6 hours ago, steph.hope said:

Haven't yet done the upgrade to v8 so I haven't been able to poke around myself to find a way, trying to understand the situation before doing the upgrade.

i'd certainly recommend playing with v8+ in a dev thoroughly before updating a production server to it. ⚠️

Link to comment
Share on other sites

If only there was a way to directly associate a user other than the owner with a  client via the API. I can only see the CreateClientInvite API, but if I do it through the UI there's an option to associate an existing User without using an invite, which is what I need.

Link to comment
Share on other sites

14 hours ago, steph.hope said:

If only there was a way to directly associate a user other than the owner with a  client via the API. I can only see the CreateClientInvite API, but if I do it through the UI there's an option to associate an existing User without using an invite, which is what I need.

almost certainly I would imagine that WHMCS is just using it's own SQL update query to do that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated