hello, i'm trying to add a notification to a user from another one programatically.
what i do is:

    $subscription = array(
      'type'          => 'author',
      'uid'           => $account->uid,
      'fields'        => array('author' => $account->uid),
      'send_method'   => notifications_user_setting('send_method', $GLOBALS['user']),
      'send_interval' => notifications_user_setting('send_interval', $GLOBALS['user']),
      'event_type'    => 'node',
    );
    notifications_save_subscription($subscription);

where $account is the user i want to follow. but it looks like i'm always getting a subscription added to __myself__
(I get a notification called 'Admin' etc...).

Comments

gunzip’s picture

Status: Active » Fixed

ok i was wrong and account was still pointing to mine.

(it was somewhat difficult to track how to add notifications programatically,
i didn't find it into the developer documentation)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.