PHPackages                             remp/crm-onboarding-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. remp/crm-onboarding-module

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

remp/crm-onboarding-module
==========================

CRM Onboarding Module

4.4.0(10mo ago)040.2k↑16.7%1MITPHPPHP ^8.1

Since Nov 27Pushed 5mo ago7 watchersCompare

[ Source](https://github.com/remp2020/crm-onboarding-module)[ Packagist](https://packagist.org/packages/remp/crm-onboarding-module)[ Docs](https://remp2030.com)[ RSS](/packages/remp-crm-onboarding-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (65)Used By (1)

CRM Onboarding Module
=====================

[](#crm-onboarding-module)

[![Translation status @ Weblate](https://camo.githubusercontent.com/6b442adc3181998b62feca6b2e5bb77b315563249faf9cf0465107eb51c0444c/68747470733a2f2f686f737465642e7765626c6174652e6f72672f776964676574732f72656d702d63726d2f2d2f6f6e626f617264696e672d6d6f64756c652f7376672d62616467652e737667)](https://hosted.weblate.org/projects/remp-crm/onboarding-module/)

Onboarding module lets you define goals that your users should achieve. The goal is merely a label with flag describing whether it was finished by a user or not.

Once the goal is defined, head to the Scenario builder and create a scenario including "Goal" element. The element can be configured with following properties:

- Which goals need to be completed for element to trigger "success" branch.
- How often CRM should check whether goals are completed.
- How long CRM should wait (timeout) before giving up on goal and triggering "fail" branch.

Preview[![Scenario goals overview](docs/scenario_goals.png)](docs/scenario_goals.png)

[![Scenario goal configuration](docs/scenario_goal_config.png)](docs/scenario_goal_config.png)

Installing module
-----------------

[](#installing-module)

We recommend using Composer for installation and update management.

```
composer require remp/crm-onboarding-module
```

### Enabling module

[](#enabling-module)

Add installed extension to your `app/config/config.neon` file.

```
extensions:
	- Crm\OnboardingModule\DI\OnboardingModuleExtension
```

When it's added, generate ACL for newly created module.

```
php bin/command.php user:generate_access
php bin/command.php api:generate_access
php bin/command.php application:seed
```

At this point you (superadmin) should be able to define new goals via People - Onboarding goals admin menu (`/onboarding/onboarding-goals-admin/`) and internal API token should have access to the exposed API endpoints.

If you need other roles to access goal definition, you can assign access to roles at People - Admin rights page (`/users/admin-group-admin/`).

Completing goals
----------------

[](#completing-goals)

The completion of the goal can differ based on the type of goal. Currently we plan to support two types of goals:

- *Simple*. These type of goals have to be completed explicitly for each user by calling [onboarding-goals/complete](#post-onboarding-goalscomplete) API endpoint.
- *Beam* (not available yet). These type of goals have Beam event defined as a trigger. Once the event is submitted to Beam, goal will be automatically completed for given user in CRM.

Segments of users with active onboarding goals
----------------------------------------------

[](#segments-of-users-with-active-onboarding-goals)

Command `php bin/command.php application:seed` automatically generates segments for an onboarding goals.

- Generated is only configuration and SQL query; rest is in the hands of [SegmentModule](https://github.com/remp2020/crm-segment-module/).
- These segments are locked so users cannot edit them via CRM administration.
- Each onboarding goal has it's own segment.

Users will be part of the goal's segment if they:

- are active,
- have active onboarding goal *(entry in `user_onboarding_goals` table; not completed or timed out)*.

Note: Activation of the onboarding goal for the user should be handled by your module or you can create scenario in [ScenariosModule](https://github.com/remp2020/crm-scenarios-module/). Scenario which will generate entry for each user which enters scenario's onboarding goal node *(handled by `Crm\ScenariosModule\Events\OnboardingGoalsCheckEventHandler`)*.

### Real-time segments within REMP Campaign

[](#real-time-segments-within-remp-campaign)

If you are using CRM segments in REMP Campaign, you'll need to enable handler which updates onboarding goal segments' cache in REMP Campaign. Otherwise you'll encounter situations where user completed goal but he still sees campaign's banner *(he is part of cached segment)*.

*Note: Module [RempCampaignModule](https://github.com/remp2020/crm-remp-campaign-module/) has to be installed and enabled.*

Add prepared handler into the `services` part of the config of your module:

```
services:
	- Crm\RempCampaignModule\Events\UserOnboardingGoalEventsHandler
```

And enable listeners for changes to user's onboarding goals in your modules (eg. `ExampleModule\ExampleModule.php`):

```
namespace Crm\ExampleModule;

class ExampleModule extends \Crm\ApplicationModule\CrmModule
{
    //...

    public function registerEventHandlers(\League\Event\Emitter $emitter)
    {
        //...

        // catch user onboarding events & handle them in RempCampaign's handler
        $emitter->addListener(
            \Crm\OnboardingModule\Events\UserOnboardingGoalCreatedEvent::class,
            $this->getInstance(\Crm\RempCampaignModule\Events\UserOnboardingGoalEventsHandler::class)
        );
        $emitter->addListener(
            \Crm\OnboardingModule\Events\UserOnboardingGoalCompletedEvent::class,
            $this->getInstance(\Crm\RempCampaignModule\Events\UserOnboardingGoalEventsHandler::class)
        );
        $emitter->addListener(
            \Crm\OnboardingModule\Events\UserOnboardingGoalTimedoutEvent::class,
            $this->getInstance(\Crm\RempCampaignModule\Events\UserOnboardingGoalEventsHandler::class)
        );
        //...
    }

    //...
}
```

API documentation
-----------------

[](#api-documentation)

All examples use `http://crm.press` as a base domain. Please change the host to the one you use before executing the examples.

All examples use `XXX` as a default value for authorization token, please replace it with the real tokens:

- *API tokens.* Standard API keys for server-server communication. It identifies the calling application as a whole. They can be generated in CRM Admin (`/api/api-tokens-admin/`) and each API key has to be whitelisted to access specific API endpoints. By default the API key has access to no endpoint.
- *User tokens.* Generated for each user during the login process, token identify single user when communicating between different parts of the system. The token can be read:
    - From `n_token` cookie if the user was logged in via CRM.
    - From the response of [`/api/v1/users/login` endpoint](https://github.com/remp2020/crm-users-module#post-apiv1userslogin) - you're free to store the response into your own cookie/local storage/session.

API responses can contain following HTTP codes:

ValueDescription200 OKSuccessful response, default value400 Bad RequestInvalid request (missing required parameters)403 ForbiddenThe authorization failed (provided token was not valid)404 Not foundReferenced resource wasn't foundIf possible, the response includes `application/json` encoded payload with message explaining the error further.

---

#### POST `/onboarding-goals/complete`

[](#post-onboarding-goalscomplete)

API call completes *simple* goal for specific user.

##### *Headers:*

[](#headers)

NameValueRequiredDescriptionAuthorizationBearer *String*yesBearer token.##### *Body:*

[](#body)

```
{
	"goal_code": "demo", // String; required; code of the simple goal
	"user_id": 301109 // Integer; required; ID of user completing the goal
}
```

##### *Examples:*

[](#examples)

curl```
curl -X POST \
  http://crm.press/api/v1/onboarding-goals/complete \
  -H 'Content-Type: application/javascript' \
  -H "Authorization: Bearer XXX" \
  -d '{
	"goal_code": "demo",
	"user_id": 301109
}'
```

raw PHP```
$payload = [
    "goal_code" => "demo",
    "user_id" => 301109,
];
$jsonPayload = json_encode($payload);
$context = stream_context_create([
        'http' => [
            'method' => 'POST',
            'header' => "Content-Type: type=application/json\r\n"
                . "Accept: application/json\r\n"
                . "Content-Length: " . strlen($jsonPayload) . "\r\n"
                . "Authorization: Bearer XXX",
            'content' => $jsonPayload,
        ]
    ]
);
$response = file_get_contents("http://crm.press/api/v1/onboarding-goals/complete", false, $context);
// process response (raw JSON string)
```

Response:

```
{
    "status": "ok"
}
```

---

#### GET `/onboarding-goals/list`

[](#get-onboarding-goalslist)

Endpoint to list available all goals.

##### *Headers:*

[](#headers-1)

NameValueRequiredDescriptionAuthorizationBearer *String*yesBearer token.##### *Examples:*

[](#examples-1)

curl```
curl -X GET \
  http://crm.press/api/v1/onboarding-goals/list \
  -H 'Content-Type: application/javascript' \
  -H "Authorization: Bearer XXX"
```

raw PHP```
$context = stream_context_create([
        'http' => [
            'method' => 'GET',
            'header' => "Content-Type: type=application/json\r\n"
                . "Accept: application/json\r\n"
                . "Authorization: Bearer XXX",
        ]
    ]
);
$response = file_get_contents("http://crm.press/api/v1/onboarding-goals/list", false, $context);
// process response (raw JSON string)
```

Response:

```
{
    "status": "ok",
    "goals": [
        {
            "name": "Demo", // name of the goal (to display)
            "code": "demo", // code of the goal (for backend communication)
            "type": "simple" // type of goal
        },
        // ...
    ]
}
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance64

Regular maintenance activity

Popularity27

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Recently: every ~25 days

Total

64

Last Release

311d ago

Major Versions

0.37.0 → 1.0.0-beta12022-01-03

0.38.0 → 1.0.0-beta22022-02-03

0.39.0 → 2.0.02022-08-25

2.11.0 → 3.1.02024-01-22

3.7.0 → 4.0.02025-04-02

PHP version history (5 changes)0.7.0PHP ^7.2

0.30.0PHP ^7.3

0.35.0PHP ^7.4

2.0.0PHP ^8.0

3.1.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c733f9bd683c3814197d8a532b7da1ba1f631bb1efe1cde5f064feab1e24877?d=identicon)[rootpd](/maintainers/rootpd)

![](https://www.gravatar.com/avatar/a05541c0b35f43d95db5342210e1d9e64242888812d13f5b096df48b6aabd863?d=identicon)[msvitok](/maintainers/msvitok)

![](https://www.gravatar.com/avatar/2c30fdbc85cda35b94f7f59399918193a0289152281abcef344ec9ee82864177?d=identicon)[markoph](/maintainers/markoph)

---

Top Contributors

[![markoph](https://avatars.githubusercontent.com/u/6843562?v=4)](https://github.com/markoph "markoph (59 commits)")[![miroc](https://avatars.githubusercontent.com/u/1230714?v=4)](https://github.com/miroc "miroc (44 commits)")[![rootpd](https://avatars.githubusercontent.com/u/812909?v=4)](https://github.com/rootpd "rootpd (18 commits)")[![lubos-michalik](https://avatars.githubusercontent.com/u/63700066?v=4)](https://github.com/lubos-michalik "lubos-michalik (2 commits)")[![zoldia](https://avatars.githubusercontent.com/u/1526070?v=4)](https://github.com/zoldia "zoldia (1 commits)")[![Matefko](https://avatars.githubusercontent.com/u/22897457?v=4)](https://github.com/Matefko "Matefko (1 commits)")[![weblate](https://avatars.githubusercontent.com/u/1607653?v=4)](https://github.com/weblate "weblate (1 commits)")[![davidkvasnovsky](https://avatars.githubusercontent.com/u/12381721?v=4)](https://github.com/davidkvasnovsky "davidkvasnovsky (1 commits)")

### Embed Badge

![Health badge](/badges/remp-crm-onboarding-module/health.svg)

```
[![Health](https://phpackages.com/badges/remp-crm-onboarding-module/health.svg)](https://phpackages.com/packages/remp-crm-onboarding-module)
```

###  Alternatives

[imanghafoori/laravel-video

A laravel package to stream video content.

28355.5k](/packages/imanghafoori-laravel-video)[gourmet/knp-menu

KnpMenu for CakePHP 3

1450.7k3](/packages/gourmet-knp-menu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
