Message Subscribe not sending created message to term followers, only to author

Created on 27 February 2015, over 9 years ago
Updated 6 January 2024, 6 months ago

Summary: 'message_subscribe_send_message' is not sending message to users following a term (following a node works just fine).

1. When a node is created, a message is created, visible in view. The messages are in a feature, all looks as it should.
2. Custom module is supposed to send the messages. Via the message_subscribe settings, the message IS sent to the author of the post. Here is the function:

function adpc_message_node_insert($node) {
// Create new message
  $message = message_create('node_created', array('uid' => $node->uid));
  $wrapper = entity_metadata_wrapper('message', $message);
  $wrapper->field_node_ref->set($node);
  $wrapper->field_published->set($node->status);
  // Let message-notify deliver the email, and send the message for us.
  // We pass in the options the field names, that will be used to capture
  // the rendered message, and provide an email log.
  $options = array(
    'rendered fields' => array(
      'message_notify_email_subject' => 'field_message_rendered_subject',
      'message_notify_email_body' => 'field_message_rendered_body',
    ),
  );
  message_notify_send_message($message, $options);
  if (module_exists('message_subscribe')) {
    // If Message-subscribe exists, let this example module use it.
    message_subscribe_send_message('node', $node, $message, array('email' => $options));
  }
}

3. The node creation message is NOT sent to the followers of the term.
4. The comment creation message IS sent to followers of the POST.

Things I double checked:
1. Flag is default 'subscribe_term', bundle included is vocab, "Team Posts"
2. /admin/config/system/message-subscribe has Flag prefix 'subscribe'
3. on /admin/config/system/message-subscribe 'notify author' is checked.
4. As a part of testing, I enabled the message subscribe 'email_term' flag, no go.

This was working at one point, and for the life of me, I have no idea what changed. I think I changed the relevant vocabulary, but that is correctly selected as a bundle in the flag.

I can get a somewhat similar functionality working with a rule (loosely using https://www.drupal.org/node/2381181 β†’ ), except that the tokens in the message are not properly filled in. I would rather NOT use the rules, though if necessary, I can and would appreciate help getting the correct message entity rather than creating a new entity as a part of the rule.

Useful info:

*EDIT*: I updated to the dev version of all message modules. No change.
drush pml | grep message
ADPC ADPC Message (adpc_message) Module Enabled 7.x-1.0-beta1
Message Message (message) Module Enabled 7.x-1.9
Message Message example (message_example) Module Not installed 7.x-1.9
Message Message notify (message_notify) Module Enabled 7.x-2.5
Message Message notify example (message_notify_example) Module Not installed 7.x-2.5
Message Message OG example (message_og_example) Module Not installed 7.x-1.9
Message Message subscribe (message_subscribe) Module Enabled 7.x-1.0-rc2
Message Message subscribe UI (message_subscribe_ui) Module Enabled 7.x-1.0-rc2
Other Message subscribe email (message_subscribe_email) Module Enabled 7.x-1.0-rc2
Flags Flag (flag) Module Enabled 7.x-3.5
Flags Flag actions (flag_actions) Module Enabled 7.x-3.5
Flags Flag Bookmark (flag_bookmark) Module Not installed 7.x-3.5

πŸ’¬ Support request
Status

Closed: outdated

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mariagwyn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024