By default, Matador can se the following fields when it creates a Web Response / Job Submission in Bullhorn:
- candidate
- jobOrder
- source
- status
- dateWebResponse
- owners
- sendingUser
You may wish to modify the value set to one of these fields, or set an additional field (e.g. set a custom field).
Matador contains several filters to enable these sorts of customisations.
Customising the ‘source’ field
The ‘matador_data_source_description’ filter can be used to customise the source field set on the Web Response / Job Submission:
/**
* Matador Data Source Description
*
* Modify the string value passed to the "source" field of an external resource, ie: Bullhorn, during a sync
* that creates or updates remote records. Default is "{Site Name} Website", ie: "ACME Staffing Website".
* Use the $context argument to narrow the modification to only certain types of external data.
*
* @since 3.1.1
* @since 3.4.0 added $data parameter
* @since 3.5.0 added $submission parameter
*
* @var string $source The value for Source. Limit of 200 characters for Candidates, 100 for
* JobSubmissions. Default is the value of the WordPress "website name" setting.
* @var string $context Limit scope of filter in filtering function
* @var stdClass $data The associated data with the $context. Should not be used without $context first.
* @var array $submission The associated data with the $context's submission.
*
* @return string The modified value for Source. Warning! Limit of 200 characters for Candidates, 100 for JobSubmissions.
*/
'source' => substr( apply_filters( 'matador_data_source_description', get_bloginfo( 'name' ), 'submission', $candidate->candidate, $application ), 0, 100 ),
For example:
add_filter( 'matador_data_source_description', 'set_custom_matador_source_for_submissions', 10, 4 );
/**
* Set the source value for job submissions only.
*
* @param string $source The original source value.
* @param string $context The context of the data source.
* @param stdClass $data The associated data (e.g., candidate).
* @param array $submission The job submission data.
*
* @return string The modified source value.
*/
function set_custom_matador_source_for_submissions( $source, $context, $data, $submission ) {
if ( 'submission' === $context ) {
return 'My Matador Job Board';
}
return $source;
}
Customising the ‘status’ field
The ‘matador_data_source_status’ filter can be used to customise the status of a Web Response / Job Submission:
/**
* Matador Data Status Description
*
* Adjusts the value of the status for the Bullhorn data item. IE: "New Lead"
*
* @since 3.5.1
*
* @var string $status The value of status. Set initially by default or by settings.
* @var string $context Limit scope of filter in to an entity
* @var stdClass $data The associated data with the $context. Should not be used without $context first.
* @var array $submission The associated data with the $context's submission.
*
* @return string The filtered value of status.
*/
'status' => apply_filters( 'matador_data_source_status', $status, 'submission', $candidate->candidate, $application ),
For example:
add_filter( 'matador_data_source_status', 'custom_status_based_on_department', 10, 4 );
/**
* Set Bullhorn status dynamically based on the department field in the application data.
*
* @param string $status The original status value.
* @param string $context The context (e.g., 'submission').
* @param stdClass $data The associated data (e.g., candidate).
* @param array $submission The job submission data.
*
* @return string The modified status.
*/
function custom_status_based_on_department( $status, $context, $data, $submission ) {
if ( 'submission' !== $context || empty( $submission['department'] ) ) {
return $status;
}
$department = strtolower( $submission['department'] );
if ( str_contains( $department, 'sales' ) ) {
return 'Sales Prospect';
} elseif ( str_contains( $department, 'engineering' ) || str_contains( $department, 'development' ) ) {
return 'Tech Talent';
} elseif ( str_contains( $department, 'marketing' ) ) {
return 'Marketing Lead';
} elseif ( str_contains( $department, 'hr' ) || str_contains( $department, 'human resources' ) ) {
return 'HR Candidate';
}
return $status;
}
Customising any field
The ” can be used to customise any field on the Web Response / Job Submission
/**
* Matador Bullhorn Submit Candidate to Job Body Filter
*
* Enable adding or modifying the Bullhorn body for the submit candidate to job request.
*
* @since 3.9.11
*
* @var array $body The request body.
* @var stdClass $candidate The Candidate Object.
* @var int $job_id The ID of the Job.
* @var array $application The application's data array.
*
* @return array $body The request body.
*/
$body = apply_filters( 'matador_bullhorn_submit_candidate_to_job_body', $body, $candidate, $job_id, $application );
For Example:
add_filter('matador_bullhorn_submit_candidate_to_job_body', 'matador_threep_add_address_fields_to_job_submission', 10, 4 );
function matador_custom_add_address_fields_to_job_submission ( $body, $candidate, $job_id, $application ) {
$body['customText1'] = $application['country'] ?? '';
$body['customText2'] = $application['state'] ?? '';
$body['customText3'] = $application['city'] ?? '';
return $body;
};