My goal is to setup mail notifications for the recipient of new statuses, and to assign the sender some userpoints on a specific point category.

I'm using the 3.0-beta2 version and I could not find a way to work things out. The rules integration has changed since v2 so answers to previous issues on the same topic are not applicable (for the send mail part).

Is there a recommended rules usage to achieve the notifications in v3 ?

While testing, I also found that status tokens available with the rules UI are not working.

Before digging further, could I get a picture on the current rules/token status in v3.0-beta2 ? Are these features available on is it still in development ?

Thanks for that great module :)

Comments

djevans’s picture

Hi,

I'm using FBSS Rules for a different purpose (logging heartbeat activity when new statuses are saved), but I'm having a similar issue with token values not being replaced.

Could the reason for this be that there's a mismatch between the arguments to the 'facebook_status_save' event in fbss_rules_rules_event_info() and the calls to rules_invoke_event() in fbss_rules_facebook_status_save()?

/**
 * Implementation of hook_rules_event_info().
 */
function fbss_rules_rules_event_info() {
  return array(
    // snipped
    'facebook_status_save' => array(
      'label' => t('User saves a status'),
      'module' => 'Facebook-style Statuses',
      'arguments' => array(
        'recipient' => array('type' => 'number', 'label' => t('The ID of the object to which the status was posted.')),
        'sender' => array('type' => 'user', 'label' => t('The user who posted the status.')),
        'status' => array('type' => 'facebook_status', 'label' => t('The status.')),
      ),
    ),
  );
}

/**
 * Implementation of hook_facebook_status_save().
 */
function fbss_rules_facebook_status_save($status, $context, $edit) {
  if ($edit) {
    rules_invoke_event('facebook_status_edit', $status, $context);
  }
  else {
    rules_invoke_event('facebook_status_save', $status, $context);
  }
}

icecreamyou’s picture

Category: support » bug
Status: Active » Fixed

Nice, catch, djevans. That was indeed the problem. Committed fix to dev. (Also my first real Git commit!)

erik2e’s picture

Version: 6.x-3.0-beta2 » 6.x-3.x-dev
Status: Fixed » Closed (fixed)

Problem is fixed using the latest dev. Could not find any trouble with token once module is updated, my notifications are working fine.

Thanks to djevans for the fix, and congratulations to IceCreamYou for your first Git commit !

mastermtg’s picture

Status: Closed (fixed) » Needs review

I also am trying to setup mail notifications for the recipient of new statuses as the orginal poster.

When I goto triggered rules on EVENT 'User saves a status' I put IF 'status was posted to own profile' then for DO I want to select a condition 'send a mail to user' but it's not listed. All that is listed is send an email to arbitrary mail address where there is no tokens for poster and owner of the status.

So i'm putting re-opening this to review cuz I believe it's directly related.

Note: I am using the latest dev, and 'send a mail to a user' was in the v3.0-beta2 and it has an option to choose the recipient and I believe an option for the user who is the is the reciever of the status (who's wall it was posted) should be an option under 'Recipient:' that way the email will be sent out to them.

icecreamyou’s picture

Status: Needs review » Fixed

Re #4: That is actually a different and much more difficult problem. Please open a new issue for it and link to this thread/comment in the issue description.

Basically, there are two solutions to getting the recipient's information in token form in Rules. One is to create a different event for every recipient type. This is fine, but sort of annoying for users, and it removes the point of having a condition for the recipient type. The other possible solution is to dynamically include token information for the recipient in the list of tokens for status updates based on the recipient type. This is a little annoying technically for types like "og" (which is really a node). Also, this would result in tokens for all recipient types being listed on the rules page, even though only some of them will be applicable in each situation.

Status: Fixed » Closed (fixed)

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