Following a question about Solid Affiliate Triggers in the Flowmattic Facebook group, I set about looking at what was available to notify about A new affiliate sign-up and also an affiliate referral.
I initially settled on solid_affiliate_trigger_new_referral
and Solid_affiliate/Affiliate/new_registration/success
As my chosen action hooks, but on trying with solid_affiliate/Affiliate/new_registration/success
I was having intermittent success; it would only trigger on the frontend, not the backend, and I’d still need to look up the data again.
I haven’t tested solid_affiliate_trigger_new_referral
But I see no reason this shouldn’t work. For the rest of the article, I am going to work on an alternative to Solid_affiliate/Affiliate/new_registration/success
and explain how I came about a working version.
Initial Failure
Following the initial failure, I experienced with Solid_affiliate/Affiliate/new_registration/success
, I decided to see what fires in general when I add a new affiliate and see if there was something more suitable to use in that case.
So I set about adding a snippet to record to my debug log every Solid Affiliate Action when I navigate and create an affiliate using the below snippet.
// Ensure plugin is available
if ( ! function_exists( 'is_plugin_active' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
// Only activate if Solid Affiliate is active
if ( is_plugin_active( 'solid_affiliate/plugin.php' ) ) {
// Listen on *all* hooks with a very early priority
add_action( 'all', function( $hook_name, $arg1 = null ) {
// Only log Solid Affiliate hooks
if ( strpos( $hook_name, 'solid_affiliate' ) === 0 || strpos( $hook_name, 'data_model_' ) === 0 ) {
//
if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
$args = func_get_args();
// Remove the hook name from args list
array_shift( $args );
error_log( sprintf(
'[SolidAFF-] Hook fired: %s, args: %s',
$hook_name,
print_r( $args, true )
) );
}
}
}, 0 );
}
PHP
This gave me a lot of data, a very small extract is below
2025 09:42:02 UTC [SA-SPY] Hook fired: solid_affiliate/settings/get, args: Array ( [0] => Array ( [0] => affiliate_manager-new_affiliate [1] => affiliate_manager-new_referral ) [1] => email_notifications )
Custom 15-May-2025 09:41:58 UTC [SA-SPY] Hook fired: data_model_solid_affiliate_affiliates, args: Array ( [0] => SolidAffiliate\Models\Affiliate Object ( [table:protected] => solid_affiliate_affiliates [primary_key:protected] => id [attributes:protected] => Array ( [id] => 19 [user_id] => 1 [affiliate_group_id] => 0 [commission_type] => site_default [commission_rate] => 20 [payment_email] => test@test.com [mailchimp_user_id] => [first_name] => test [last_name] => test [registration_notes] => test [status] => approved [custom_registration_data] => [] [created_at] => 2025-05-15 09:41:58 [updated_at] => 2025-05-15 09:41:58 ) [properties:protected] => Array ( ) ) )
Custom 15-May-2025 09:41:58 UTC [SA-SPY] Hook fired: solid_affiliate/admin_list_table_configs/Affiliate, args: Array ( [0] => SolidAffiliate\Lib\VO\ListTableConfigs Object ( [model_class] => SolidAffiliate\Models\Affiliate [data] => Array ( [model_class] => SolidAffiliate\Models\Affiliate [singular] => Affiliate [plural] => Affiliates [schema] => SolidAffiliate\Lib\VO\Schema Object ( [entries] => Array ( [id] => SolidAffiliate\Lib\VO\SchemaEntry Object ( [data] => Array ( [type] => bigint [length] => 20 [auto_increment] => 1 [primary_key] => 1 [show_list_table_column] => 1 [display_name] => Affiliate ID [form_input_description] => The ID of the Affiliate. Cannot be changed. [show_on_edit_form] => disabled [user_default] => [validate_callback] => Closure Object ( [parameter] => Array ( [$id] => ) ) [sanitize_callback] => Closure Object ( [parameter] => Array ( [$id] => ) ) [is_csv_exportable] => 1 ) [primary_key] => 1 [auto_increment] => 1 [key] => [unique] => [type] => bigint [form_input_type_override] => [length] => 20 [required] => [display_name] => Affiliate ID [is_enum] => [enum_options] => Array ( ) [show_on_new_form] => [show_on_edit_form] => disabled [show_on_preview_form] => [show_list_table_column] => 1 [show_on_non_admin_edit_form] => [show_on_non_admin_new_form] => [form_input_placeholder] => [form_input_description] => The ID of the Affiliate. Cannot be changed. [form_tooltip_content] => [form_tooltip_class] => [label_for_value] => [default] => [user_default] => [settings_group] => [settings_tab] => [custom_form_input_attributes] => Array ( ) [hide_form_input_title] => [hide_form_description] => [shows_placeholder] => 1 [form_input_wrap_class] => [form_label_class] => [form_description_class] => [persist_value_on_form_submit] => 1 [validate_callback] => Closure Object ( [parameter] => Array ( [$id] => ) ) [sanitize_callback] => Closure Object ( [parameter] => Array ( [$id] => ) ) [form_input_callback_key] => [is_password] => [nullable] => [is_sortable] => 1 [is_zero_value_allowed] => [is_csv_exportable] => 1 [csv_export_callback] => ) [user_id] =>
Another Swing and a Miss!
So I settled on data_model_solid_affiliate_affiliates
and ran that, but immediately, it was clear we where getting about four triggers per addition, so looking through my logs and applying some logic was needed. I had the following triggers available to me
data_model_solid_affiliate_affiliates_inserted
data_model_solid_affiliate_affiliates_updated
data_model_solid_affiliate_affiliates_save
I decided that by targeting the _inserted
one, I would get exactly one call when a brand‐new affiliate record is created. i.e an insertion
This worked as planned. We now successfully get data, but it’s not the format I wanted for FlowMattic.
Finishing Off
So now that I had the data, I worked on the array and wanted to add a separate action to fire that could be captured in flowmattic. The reason for this was so we could use the plugin or WordPress action trigger and not have separate webhook triggers.
I settled on the following snippet to capture, lookup and pull the data and pass it to the action hook.
// Ensure is_plugin_active() is available
if ( ! function_exists( 'is_plugin_active' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
// Only hook if Solid Affiliate is active
if ( is_plugin_active( 'solid_affiliate/plugin.php' ) ) {
// Fires exactly once when a new affiliate record is inserted
add_action(
'data_model_solid_affiliate_affiliates_inserted',
'sat_trigger_custom_affiliate_action',
10,
1
);
}
/**
* Fires a custom action passing a named array of affiliate data.
*
* @param SolidAffiliate\Models\Affiliate $affiliate_obj
*/
function sat_trigger_custom_affiliate_action( $affiliate_obj ) {
// Pull protected attributes via magic getter
if ( method_exists( $affiliate_obj, '__get' ) ) {
$data = $affiliate_obj->__get( 'attributes' );
} else {
$data = [];
}
/**
* Fires after a Solid Affiliate record is inserted,
* passing a named array for easy mapping.
*
* @param array $data {
* @type int $id
* @type int $user_id
* @type int $affiliate_group_id
* @type string $commission_type
* @type float $commission_rate
* @type string $payment_email
* @type string $mailchimp_user_id
* @type string $first_name
* @type string $last_name
* @type string $registration_notes
* @type string $status
* @type string $custom_registration_data
* @type string $created_at
* @type string $updated_at
* }
*/
do_action( 'sa_aff_created_trigger', $data );
}
PHP
so our trigger becomes sa_aff_created_trigger
in FlowMattic, as can be seen below

We get the following data in flowmattic for that signup.

You can view the bubble below to see this in action: