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

How to deal with multiple user models? #190

Open
rathboma opened this issue Dec 14, 2022 · 3 comments
Open

How to deal with multiple user models? #190

rathboma opened this issue Dec 14, 2022 · 3 comments
Labels
question Further information is requested

Comments

@rathboma
Copy link
Contributor

Hey folks,

I have both Customer and User models, each represents a different type of user (I know, I know).

The docs let me set a different user model, but is there a way to use heya with two user models at the same time?

Something like this?

# config/initializers/heya.rb
Heya.configure do |config|
  config.user_types = ["MyUser", "MyCustomer"]
end
@joshuap
Copy link
Member

joshuap commented Dec 20, 2022

Hi @rathboma, we don't support multiple user models at the global level, but you should be able to set a different user_type per campaign (see here):

class UserOnboardingCampaign < ApplicationCampaign
  user_type "MyUser"

  # ...
end

class CustomerOnboardingCampaign < ApplicationCampaign
  user_type "MyCustomer"

  # ...
end

This is not something I have actually tried doing in practice, however—so you might be the first to explore multi-user campaigns. 😁

@joshuap
Copy link
Member

joshuap commented Dec 20, 2022

If you do try this, would love if you could report back and let me know how it works. I'll leave this open for now as it's an undocumented feature.

@joshuap joshuap added the question Further information is requested label Dec 20, 2022
@rathboma
Copy link
Contributor Author

rathboma commented Mar 8, 2023

Haven't tried this yet, but starting to play around with it.

Actually just googled this question during coding and hit my own issue, lol.

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

No branches or pull requests

2 participants