Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact type on user creation #53

Open
jbonlinea opened this issue Oct 5, 2023 · 0 comments
Open

Contact type on user creation #53

jbonlinea opened this issue Oct 5, 2023 · 0 comments

Comments

@jbonlinea
Copy link

jbonlinea commented Oct 5, 2023

Hi @christianwach

I have a question, which might turn to be bigger than an simple question, but here it is.

In my set up I do use three types of Civi-contact :

  • the built in individual type
  • a custom organization named "institution", and
  • a custom organization named "lab"

When a user is created in wordpress, civicrm-wp-profile sync will create the linked civi-contact, that's great. Out of the box it is an individual and it's fine most of the time in my use case, but sometimes I need to specify the civi-contact-type that I want. At the moment, I haven't found any way to achieve that, have I missed something ?

I agree that there is always "someone" acting so a "person" which is ultimately an individual, but one may act in the name of an organization, and want to handle a user account which is not his personal account but the one of his organization.

One workaround could be to create the organization in civi first, then create the user account from civi. Thecnically it works, but the organization can't create their own wp-account by themselves, which is kind of a shame.

Another workaround I could think of, but fails, would be to create the institution first, then the wp-user from wp-admin. In this case civicrm-wp-profile-sync create a new individual civi-contact. It happends as if civicrm-wp-profile-sync only use dedup rules against individuals, not organizations.

A ultimate workaround could be to create the wp-user first, then change the contact type in civi thank's to the civi extention contact-editor. II've tired but the plug-returns that "The contact has custom data that is not valid for the new type, and I indeed use civi custom field for individuals.
it requires to monitor account-creation and check whether it should be an individual or an organization and do a manual edit accordingly, which is kind of the worst scenario.

At this stage I don't see any other solution, but I may have missed something !

With further development, of the plug-in, I could see an extra field on the wp-user account with a radio selector that enable us to select the type of contact we want to create/be-synced (it's ok if the radio selector is not editable once the account created, and switching contact type remain handeled in civi). Adding this radio selector is simple using civi acf fields, but it still requires civicrm-wp-profile-sync to check the value of this field and act accordingly. At first glance it seems enough to address this use case, especially if this field can be set in a custom form to create account.

Maybe you've already thought of this use case and have an other workflow to handle it, I would be curious to hear it :)

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant