Customize your Client Portal’s welcome message and make it more personal for your customers.
On this page you can find an example of how to customize the dashboard message in your Jetpack CRM Client Portal.
The provided code snippet allows for personalization, such as displaying a welcome message with the client’s name.
Important note on support the Client Portal personalization
The code snippet below is provided as-is for example purposes. We do not provide support for custom code.
If you require assistance with implementing or modifying this code, we recommend consulting a developer.
Understand the customization example
if you want to enhance your Client Portal dashboard with a personalized greeting, like “Hi, Mike, welcome to your dashboard.” , the following plugin example demonstrates how to achieve this using the dashboard content filter.
<?php
/*
Plugin Name: Jetpack CRM Portal Filter Plugin
Plugin URI: https://jetpackcrm.com
Description: Jetpack CRM is the simplest CRM for WordPress. Customize the Dashboard welcome message with this plugin.
Version: 1.0
Author: Jetpack CRM
Author URI: https://jetpackcrm.com
Text Domain: zero-bs-crm
*/
add_filter('zbs_portal_dashboard_content', 'zeroBS_custom_portal_dashboard_filter');
function zeroBS_custom_portal_dashboard_filter($dashboard){
$uid = get_current_user_id();
$uinfo = get_userdata( $uid );
$cID = zeroBS_getCustomerIDWithEmail($uinfo->user_email);
if($cID > 0){
//again if we have a contact returned, get the meta
$customer_meta = zeroBS_getCustomerMeta($cID);
$dashboard = "<p>";
$dashboard .= "Hello " . $customer_meta['fname'] . ", welcome to your Dashboard";
$dashboard .= "</p>";
return $dashboard;
}
return $dashboard;
}
?>
This code snippet works by checking if the Jetpack CRM core is active. It then modifies the dashboard content only if a contact ID is successfully linked to the currently logged-in WordPress user, dynamically inserting their first name into the welcome message.
How to implement this code
You have several options for implementing this code:
- Snippet plugin: the safest and most recommended method is to use a dedicated snippet plugin for WordPress. This allows you to add custom code without directly editing your theme files.
- Theme
functions.phpfile: if you are comfortable with code, you can add this to your child theme’sfunctions.phpfile. Directly editing parent theme files is not recommended as updates will overwrite your changes. - Developer assistance: if you are not comfortable adding custom code yourself, we suggest seeking help from a freelance developer. This task is generally straightforward for someone with development experience.
And where exactly should I add that code?
Is it not problematic to break my site when I just change code in the .php file?
Thanks for your help –
Thomas
Hi Thomas,
You could add this via a Snippet plugin, or if you’re not comfortable adding custom code we might recommend getting developer help (perhaps from a freelance developer), to do this for you. It should be a fairly straight forward job if you’re using code such as the above (depending on what you want to show on the page).