NS Pro - API?

2 weeks 5 days ago #1 by Chris Paschen
Is there any API or ability to somewhat easily write plugins to integrate my custom components with NS Pro?

We've been doing this with AcyMailing for a couple years and with their latest changes we need to find a new alternative.

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

2 weeks 2 days ago - 2 weeks 2 days ago #2 by Christopher Mavros
Hello Chris and thank you for posting on our forum!

You can easily access NS Pro functions by including the lib.php file, found at
JPATH_ADMINISTRATOR.'/components/com_nspro/lib.php

This file contains functions such as:
/*
 *  $subscriber_object: The subscriber row from the database
 *  $scheduled_type_int: an integer value that indicates what type of scheduled newsletters to send
 */
SendAutoResponders($subscriber_object, $scheduled_type_int)

/*
 *  $mailing_lists: Comma separated string with Mailing List IDs
 *  $sub_id: Subscriber ID
 */
DoRemoveListsFromSubscriber($mailing_lists, $sub_id)

/*
 *  $mailing_lists: Comma separated string with Mailing List IDs
 *  $sub_id: Subscriber ID
 */
DoAddListsToSubscriber($mailing_lists, $sub_id)

/*
 *  $sub_id: Subscriber ID
 */
DoDeleteSubscriber($sub_id)

/*
 *  $name: Subscriber name
 *  $email: Subscriber email, based on which this function either inserts or updates a subscriber.
 *  $datetime: Date string from date function with Y-m-d H:i:s format.
 *  $conf: Boolean or string indicating if the subscriber email is confirmed
 *  $mailing_lists: Comma separated string with Mailing List IDs
 *  $update: Whether an existing record should be updated or not
 *  $source: String indicating source of subscription to retrieve saved parameters
 *  $source_id: Menu item ID for $source 'component' or Module ID for $source 'module'
 */
add_or_update_subscriber($name, $email, $datetime, $conf, $mailing_lists, $update = true, $source = 'component', $source_id = 'auto')

These are only some of the many useful functions that you can use from the lib.php file.

Now, concerning plugin functionality, NS Pro doesn't trigger any events to be used at the moment.
However, we would love to implement whatever you need to use NS Pro!
Would you like to tell me some event examples that you would like to use? For example something like "onSubscriberAdded"?

Christopher Mavros
mavrosxristoforos@gmail.com
Serving the Joomla! community with extensions since 2008.

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

Moderators: Christopher Mavros