Support

Account

Home Forums ACF PRO Automatically assign user company based on email domain

Helping

Automatically assign user company based on email domain

  • Currently I am using UltimateMember for our subscribers. I also have a CPT called Companies and created an ACF relationship field to Companies CPT for users.

    When a user registers, we have to go in and approve their membership and then assign them to a company.

    Is there a way to automatically assign them to a Company based on their domain? For instance if their email address is @gmail.com, it would automatically select Google as their company in the ACF relationship field.

  • Create an acf/save_post action. In the action get the user’s email address and then create logic to look up the correct company and assign it to the user using update_field().

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.