How To / General

Add delay to JCohort

  • Justin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 9 months ago #1 by Justin
Add delay to JCohort was created by Justin
Hi

I am using easy profile to deal with all the user fields, I have a drop down user field that based on what the person selects adds them to a specific user group, JCohort then maps that group to a specific cohort.

What seems to be happening is that when a user selects a group on their profile page, they need to click Submit, edit their profile again and click submit again and only then are they added to the cohort.

What I suspect is happening is that when the person clicks submit Jcohort triggers before easy profile has added the person to the group as a result Jcohort does not map anything, the second time you click submit since the person is already in the group Jcohort maps them through correctly.

Is there any way I can change Jcohort so that it has a delay of lets say 2 - 5 sec so that Jcohort only tries to sync once easy profile has completed it's process.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Add delay to JCohort
Hi.

Delay is not possible. But I think it should not be needed. What you should try is make the jcohorts user plugin execute after jsn_user plugin, so that groups are set in the user.

So, go to plugins, filter by type User and sort by sortorder. Then put jcohort plugin after jsn_users plugin. I think that should make it owrk as expected.

Please Log in or Create an account to join the conversation.

  • Justin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 9 months ago #3 by Justin
Replied by Justin on topic Add delay to JCohort
Hi
I did as suggested but there seems to be no difference.
Is it perhaps possible to trigger "Sync cohorts" using a chron

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #4 by Antonio Durán
Replied by Antonio Durán on topic Add delay to JCohort
> I have a drop down user field that based on what the person selects adds them to a specific user group

How is this done? I guess you are using the paid version of Easy profle and they have something for that? If you can send it by email I can try to see how it works and look for a solution.

> Is it perhaps possible to trigger "Sync cohorts" using a chron

Code could be written for that, but it's not a nice approach. Also, I think it should not be needed if things are done the standard way in Easy profile.

Please Log in or Create an account to join the conversation.