Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Fire unsubscribe event programmatically for "soft delete"

  • GUEST
8 years 10 months ago - 8 years 10 months ago #274992 by
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.
Last edit: 8 years 10 months ago by .

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
8 years 10 months ago #275023 by nant

c_schmitz wrote:
Edit: Maybe I'll just try to call doUnsubscribeConfirm() directly.

Edit 2: Yes, above solution works.


Great!
Thanks for sharing!

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum