- Handle Custom Stripe Webhook Events
- suredonation_export_secret_option_keys Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- Validate Field Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- suredonation_phone_geo_enabled Filter Hook
- suredonation_phone_geo_api_hourly_cap Filter Hook
- suredonation_paypal_webhook_handle_event Filter Hook
- suredonation_paypal_sdk_args Filter Hook
- suredonation_output_campaign_meta_tags Filter Hook
- suredonation_new_donor_user_data Filter Hook
- suredonation_integration_payload Filter Hook
- suredonation_import_phase_mappers Filter Hook
- suredonation_import_givewp_phases Filter Hook
- suredonation_import_givewp_phase_mappers Filter Hook
- suredonation_import_donation_row Filter Hook
- suredonation_import_campaigns_limit Filter Hook
- suredonation_field_block_config Filter Hook
- suredonation_export_one_time_only Filter Hook
- suredonation_export_campaigns_limit Filter Hook
- suredonation_email_smart_tags Filter Hook
- suredonation_email_smart_tag_groups Filter Hook
- suredonation_email_field_char_limits Filter Hook
- suredonation_disable_default_styles Filter Hook
- suredonation_default_validation_messages Filter Hook
- suredonation_default_email_notifications Filter Hook
- suredonation_create_donation_data Filter Hook
- suredonation_config_abilities Filter Hook
- suredonation_available_payment_methods Filter Hook
- suredonation_allowed_form_html Filter Hook
- suredonation_allowed_form_blocks Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- suredonation_phone_geo_enabled Filter Hook
- suredonation_phone_geo_api_hourly_cap Filter Hook
- suredonation_paypal_webhook_handle_event Filter Hook
- suredonation_paypal_sdk_args Filter Hook
- suredonation_output_campaign_meta_tags Filter Hook
- suredonation_new_donor_user_data Filter Hook
- suredonation_integration_payload Filter Hook
- suredonation_import_phase_mappers Filter Hook
- suredonation_import_givewp_phases Filter Hook
- suredonation_import_givewp_phase_mappers Filter Hook
- suredonation_import_donation_row Filter Hook
- suredonation_import_campaigns_limit Filter Hook
- suredonation_field_block_config Filter Hook
- suredonation_export_secret_option_keys Filter Hook
- suredonation_export_one_time_only Filter Hook
- suredonation_export_campaigns_limit Filter Hook
- suredonation_email_smart_tags Filter Hook
- suredonation_email_smart_tag_groups Filter Hook
- suredonation_email_field_char_limits Filter Hook
- suredonation_disable_default_styles Filter Hook
- suredonation_default_validation_messages Filter Hook
- suredonation_default_email_notifications Filter Hook
- suredonation_create_donation_data Filter Hook
- suredonation_config_abilities Filter Hook
- suredonation_available_payment_methods Filter Hook
- suredonation_allowed_form_html Filter Hook
- suredonation_allowed_form_blocks Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- suredonation_enqueue_form_frontend_scripts Action Hook
- suredonation_after_form_duplicated Action Hook
- suredonation_email_sent Action Hook
- suredonation_donor_user_created Action Hook
- suredonation_donation_refunded Action Hook
- suredonation_donation_status_changed Action Hook
- suredonation_donation_completed Action Hook
- suredonation_new_donation Action Hook
- suredonation_donation_created Action Hook
suredonation_import_phase_mappers Filter Hook
Overview
The suredonation_import_phase_mappers filter allows developers to register custom mapper classes for SureDonation’s CSV import phases.
A SureDonation import runs through different phases. Each phase is mapped to a specific mapper class that processes the imported data.
Use this filter to add a custom import phase and connect it to your own mapper class.
SureDonation Pro uses this filter to add its subscriptions import phase.
When to Use This Filter
Use this filter when you need to:
- Add a custom CSV import phase.
- Register a custom mapper class.
- Extend SureDonation’s import process.
- Process custom data during an import.
- Add import support through a plugin or extension.
Filter Signature
apply_filters( 'suredonation_import_phase_mappers', $mappers);Parameters
| Parameter | Type | Description |
| $mappers | array | Map of import phase names to fully qualified mapper class names. |
Default Mappers
SureDonation provides the following built-in phase mappers:
| Phase | Mapper |
| donations | Donations_Import_Mapper::class |
| donors | Donors_Import_Mapper::class |
Return Value
Return the modified phase-to-class map.
return $mappers;
If a requested phase is not present in the returned map, its mapper resolves to null and that phase is skipped.
Basic Usage
add_filter( 'suredonation_import_phase_mappers', 'your_custom_function', 10, 1);
function your_custom_function( $mappers ) {
    // Add custom phase mappers here.
    return $mappers;
}Example: Register a Custom Import Phase
The following example registers a pledges phase with a custom mapper class.
add_filter( 'suredonation_import_phase_mappers', 'mysite_register_pledges_phase', 10, 1);
function mysite_register_pledges_phase( $mappers ) {
    $mappers['pledges'] = \MySite\Import\Pledges_Import_Mapper::class;
    return $mappers;
}How the Example Works
- SureDonation provides the existing import phase mapper map.
- The filter adds a new pledges phase.
- The fully qualified mapper class name is assigned to the phase.
- The modified map is returned.
- When the import runner reaches the pledges phase, it resolves and uses the registered mapper.
Mapper Class Requirements
The filter expects a class name, not a class instance.
Correct: $mappers[‘pledges’] = \MySite\Import\Pledges_Import_Mapper::class;
Do not pass an instantiated object: $mappers[‘pledges’] = new \MySite\Import\Pledges_Import_Mapper();
The import runner resolves the registered class to its singleton instance.
Your custom mapper should provide the same interface and behavior expected by the built-in import mappers.
The mapper receives:
- The mapped row.
- The progress payload.
- The dry-run flag.
It is also responsible for updating the appropriate phase result counters.
For a minimal implementation, refer to the Donors_Import_Mapper class.
Import Phase Flow
The filter is part of the import phase resolution process:
- A CSV import session is created.
- SureDonation determines the phases included in the import.
- The import runner requests the mapper for the current phase.
- The suredonation_import_phase_mappers filter is applied.
- SureDonation looks up the mapper class for the requested phase.
- The runner resolves the class to its singleton.
- The mapper processes the imported rows.
- The phase result counters are updated.
Important: Registering the Phase Is Not Enough
Adding a mapper to this filter does not automatically cause the import runner to execute the phase.
The custom phase must also be included in the import session’s phase list.
For example: pledges
must be present in the phases being processed before the runner can reach the registered mapper.
Extending Existing Import Phases
Be careful when replacing an existing mapper.
For example:
$mappers['donations'] = \MySite\Import\Custom_Donations_Mapper::class;This changes how SureDonation’s core donation import is processed.
If you only need to modify or extend imported donation rows, prefer using: suredonation_import_donation_row
instead of replacing the built-in donation mapper.
Example: Add a Custom Mapper Without Replacing Core Mappers
add_filter( 'suredonation_import_phase_mappers', 'mysite_add_custom_import_phase', Â 10, 1);
function mysite_add_custom_import_phase( $mappers ) {
    // Keep all existing SureDonation mappers.
    $mappers['pledges'] = \MySite\Import\Pledges_Import_Mapper::class;
    return $mappers;
}This approach preserves the existing donations and donors import behavior while adding the custom phase.
Related Hooks
- suredonation_import_donation_row:Allows developers to modify or extend imported donation rows.
- Suredonation_import_givewp_phase_mappers: Filters mapper classes used for GiveWP import phases.
- Suredonation_import_givewp_phases: Filters the phases used during GiveWP imports.
- Suredonation_import_session_created: Runs when a SureDonation import session is created.
We don't respond to the article feedback, we use it to improve our support content.