krileon wrote this:
You can't simulate a trigger without writing a bunch of code to ensure the appropriate variables are passed. Use the Dummy gateway to do testing in CBSubs to test the triggers and workflows.
We have our own quick admin page where we can do a number of tasks relevant to our page. One of these tasks is "soft delete". We want a user to automatically unsubscribe if it is soft deleted. We already have some setup code to call CB plugins from Joomla code:
Code:
// Load the CB framework
global $_CB_framework, $mainframe;
if ( defined( 'JPATH_ADMINISTRATOR' ) ) {
if ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) {
echo 'CB not installed!';
return;
}
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
} else {
if ( ! file_exists( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' ) ) {
echo 'CB not installed!';
return;
}
include_once( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' );
}
cbimport( 'cb.database' );
cbimport( 'cb.html' );
cbimport( 'cb.plugins' );
Can you help us finish this snippet, or point us to a direction where we can copy-paste some code, e.g. from the CBSubs plugin?
Thanks in advance
LimeSurvey
Edit: Maybe I'll just try to call doUnsubscribeConfirm() directly.
Edit 2: Yes, above solution works.