RISE keeps one lead for one email address. When a lead is converted to a client and the email already belongs to a client contact, RISE lets you merge the lead into that client instead of making a duplicate contact.
Lead form: same email, same lead
- When someone sends the lead form again with an email that a lead already has, RISE doesn't create a new lead.
- The existing lead is kept as it is. Only its empty fields are filled from the new form, like the phone or the city.
- The email is matched without case, so John@Example.com and john@example.com are the same.
- If the email belongs to a team member or a client contact, the form shows the "already registered" message, as before.
- A form without an email always creates a new lead.
Convert a lead to an existing client
Open the lead and click Convert to client. If a contact of this lead has the same email as a contact of a client, you'll see a message at the top of the form with two options:
| Option | What happens |
| Merge into (client name) | The lead is added to that client. Its contacts, files, notes, tasks, events, estimates, estimate requests, proposals and contracts move to the client, and the lead is removed. The client's details are kept; only its empty fields are filled from the form. The contact with the same email is merged into the client's contact. Other contacts of the lead become new contacts of the client. |
| Create a new client | The lead becomes a new client, as before. |
- Merge is selected by default. You'll see a client in the list only if you can edit that client.
- The activity history of the lead is shown on the client's page after the merge.
- If an email in the form belongs to a team member, nothing is saved and an error is shown. Change the email and save again.
For plugin developers
Create a lead from your plugin without making duplicates. Clean the data before you pass it.
$Clients_model = model("App\Models\Clients_model");
$result = $Clients_model->get_or_create_lead_by_email($email, clean_data(array(
"company_name" => "John Doe",
"type" => "person",
"lead_status_id" => $Lead_status_model->get_first_status(),
"lead_source_id" => 0,
"owner_id" => 1,
"created_date" => get_current_utc_time()
)), clean_data(array("first_name" => "John", "last_name" => "Doe")));
//$result["status"]: created, existing, email_exists (team member or client contact) or error
//$result["lead_id"], $result["contact_id"]
If your plugin keeps its own data by client id, move it when a lead is merged into a client:
app_hooks()->add_action("app_hook_lead_merged_into_client", function ($data) {
//$data["lead_id"] is removed, $data["client_id"] is the client which got the lead's records
});