Using Borlabs Opt-in for WPForms action hooks, you can transfer the data to other systems for further processing, such as an external newsletter or CRM system.
<?php
// An opt-in link has been confirmed - is triggered once when the opt-in has been confirmed
add_action('borlabsOptInWPForms/form/completed', 'myFunction');
// An opt-in link of a specific form has been confirmed - triggered once when the opt-in has been confirmed.
add_action('borlabsOptInWPForms/form/{$formId}/completed', 'myFunction');
// An opt-in link was confirmed - this hook is always executed
add_action('borlabsOptInWPForms/form/confirmed', 'myFunction');
// An opt-in link of a specific form was confirmed - this hook is always executed
add_action('borlabsOptInWPForms/form/{$formId}/confirmed', 'myFunction');
function myFunction ($entryData)
{
// Further process the data
if ($entryData->status === 'pending') {
// Opt-in has been confirmed and changes to "complete".
} else {
// Email with the opt-in link was sent
}
}
?>