there is currently no way for another plugin to be used by the same rules integration that comes with message_notify because the plugin to be used is hardcoded:

  message_notify_send_message($message, $options, 'email');

This probably should be configurable by UI to support additional plugins/ backends.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thsutton’s picture

Status: Active » Needs review
FileSize
6.2 KB

I've attached a patch for almost-finished support for all notifier plugins. This removes the single "send-message-via-email" action and instead provides an action for each plugin.

Each action allows the user to select the text field to store each view mode defined by that plugin.

Remaining work:

  • Find a better way to pass the plugin ID through to the process callback.
  • Handle plugin options properly (e.g. don't hard code mail).

If I finish these items off, is there any particular reason that this wouldn't get committed?

thsutton’s picture

The attached patch resolves the "find a better way to pass the plugin ID through to the process callback".

It also does something toward "handle plugin options properly" too: the default options defined by the plugin are now used, but there is still no way to actually configure plugin-specific options as part of the action (except the 'mail' option for the 'email' plugin; which remains hard coded).

subhojit777’s picture

Plugins will provide multiple options and they will be different from other. Handling them together will be quite difficult. I was thinking that there will be a select list where user will select desired plugin (email, sms, digest_week, digest_day, etc.), and upon selecting any plugin options will be seen by altering form states.

However, this can easily be overcome by hook_entity_insert(), although the solution will not be generic.

subhojit777’s picture

Besides patch in #2 does not work in 7.x-2.5 release. The patch was not applying cleanly. I applied the patch on latest dev release of the module, and replaced message_notify.rules.inc with stable release's rules file. As a result the action configuration was not appearing, there was only a Save button and nothing else.

subhojit777’s picture

FileSize
4.09 KB
6.36 KB

This patch simply provides a select list of available message notify plugins. Options based on selected plugin is not available in this patch. Please have a look.

subhojit777’s picture

Patch in #6 is a complete rewrite of #2

subhojit777’s picture

FileSize
480 bytes
4.05 KB

Unnecessary comment removed

subhojit777’s picture

Some minor comment and description changes.
Unnecessary function removed.

bluegeek9’s picture

Status: Needs review » Closed (outdated)