No emails are sent when using an "Send tokenized e-mail" action.
I'm running token 6.x-1.11.

Debug mode shows:

 0 ms After updating existing content has been invoked.
 10.187 ms Included MODULE.rules.inc files.
 10.809 ms Executing the rule Notify QA manager on rule set After updating existing content
 11.114 ms Condition created content is Product Test Script evaluated to TRUE.
 11.246 ms Element Send tokenized e-mail has not been executed. There are not all execution arguments available.
 11.3 ms Evaluation of After updating existing content has been finished.

This happens even when none of the email fields contain a token.

The rule:

array (
  'rules' => 
  array (
    'rules_2' => 
    array (
      '#type' => 'rule',
      '#set' => 'event_node_update',
      '#label' => 'Notify QA manager',
      '#active' => 1,
      '#weight' => '0',
      '#status' => 'custom',
      '#conditions' => 
      array (
        0 => 
        array (
          '#type' => 'OR',
          0 => 
          array (
            '#settings' => 
            array (
              '#argument map' => 
              array (
                'node' => 'node',
              ),
              'type' => 
              array (
                'product_test_script' => 'product_test_script',
              ),
            ),
            '#info' => 
            array (
              'label' => 'created content is Product Test Script',
              'arguments' => 
              array (
                'node' => 
                array (
                  'type' => 'node',
                  'label' => 'Content',
                ),
              ),
              'module' => 'Node',
              'help' => 'Evaluates to TRUE, if the given content has one of the selected content types.',
            ),
            '#name' => 'rules_condition_content_is_type',
            '#type' => 'condition',
          ),
        ),
      ),
      '#actions' => 
      array (
        0 => 
        array (
          '#type' => 'action',
          '#name' => 'rules_core_token_actions_send_email_action',
          '#info' => 
          array (
            'module' => 'System',
            'arguments' => 
            array (
              'object' => 
              array (
                'type' => 'value',
                'default value' => NULL,
              ),
            ),
            'label' => 'Send tokenized e-mail',
            'base' => 'rules_core_action_execute',
            'action_name' => 'token_actions_send_email_action',
            'configurable' => true,
          ),
          '#settings' => 
          array (
            'recipient' => 'jonesp@ca.objectiflune.com',
            'subject' => 'Test',
            'message' => 'Test',
          ),
        ),
      ),
    ),
  ),
)

Comments

fago’s picture

Status: Active » Fixed

Don't use the token actions - use actions provided by rules instead together with the token rules integration. http://drupal.org/node/286803

fago’s picture

Thanks for your report anyway - I think I've fixed the problem. Please test the next development snapshot.

paj262’s picture

I am only using actions provided by the rules GUI.

paj262’s picture

Did this fix go into the alpha7 release you just did?

paj262’s picture

Status: Fixed » Active

I tried the alpha7 release and the latest development snapshot. Both exhibit the same problem.

paj262’s picture

I just tried the latest development snapshot and things get along a little further. I recreated the rule from scratch just to make sure the rule is compatible with the new code, but I now get:

warning: Missing argument 2 for token_actions_send_email_action() in D:\drupal\www\modules\token\token_actions.module on line 131.
warning: mail() [function.mail]: SMTP server response: 503 5.5.2 Need Rcpt command. in D:\drupal\www\includes\mail.inc on line 193.
Unable to send e-mail. Please contact the site admin, if the problem persists.

fago’s picture

Status: Active » Fixed

indeed, it was still not working. I've tested and fixed it now.

Token replacements still not work though. They rely on the "context", which rules doesn't provide for the actions. So again: Don't use the token actions module, rules comes with the same, but superior (as better integrated into rules) actions. This still needs to be documented somewhere.

paj262’s picture

I am unsure how to "not use the token actions module". I can't find anything in the rules UI that suggest another way of sending an email that contains information about a node. Everything I am doing is configured via the rules interface: Action: System: Send tokenized email.

fago’s picture

just use one of the rules' system actions for sending mail: "Send a mail to a user" or "Send a mail to an arbitrary mail address". Thanks to the input filter system you can use php and token replacements there.

paj262’s picture

I tried that as well, but neither [node:nid], [nid], [node:title] or [title] seem to be replaced in "send email to arbitrary user"... Is there a different syntax I should be using?

fago’s picture

paj262’s picture

Just read and tried that. It works. Many thanks for all the help.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

whyameye’s picture

Version: 6.x-1.0-alpha6 » 6.x-1.0-beta3
Component: Code » Miscellaneous
Category: bug » support
Priority: Critical » Normal
Status: Closed (fixed) » Postponed (maintainer needs more info)

Okay I looked at http://drupal.org/node/286809 and http://drupal.org/node/286803 and I struggled for quite awhile trying to figure out what "that" was in "Just read and tried that. It works." I can't figure it out and I'd like some guidance.

I've been trying to get "Display a tokenized message to the user" as a test before I use a tokenized URL. My test message comes up on submission of a blog form and is "anything [*nid] [*type] [nid*] [type*] [nid] [type]" When I see the message on submission of my blog form, these tokens are not substituted but printed back to me verbatim when the rule is triggered.

In guessing what "just read and tried that" (post #12 dated August 21) meant, I updated Token to Token 6.x-1.x-dev and I added token.rules_.inc as mentioned in http://drupal.org/node/286803 to the Token module's directory. Nothing works. A little guidance would be appreciated.

The eventual rule I need is to force editing of a blog entry immediately after it is first created. This isn't one of your preexisting rule actions, so that's why I need a tokenized solution. The need for this immediate editing is to be a workaround for another problem: the og_vocab taxonomy only offers a list of choices in a blog submission *after* the blog post is created and not during.

Thanks,

-John

fago’s picture

Don't use token actions module!!!!!!

fago’s picture

Status: Postponed (maintainer needs more info) » Fixed
whyameye’s picture

I disabled the token actions module. Now I get:

Fatal error: Call to undefined function token_actions_message_action() in /home1/hackartl/public_html/drupal/sites/all/modules/rules/rules/modules/rules.rules.inc on line 325

I tried reinstalling token and rules modules, and still get this error.

Are you saying not to use token actions within the rules module?

fago’s picture

YES. Use the rules equivalents. Delete the others. Read http://groups.drupal.org/node/15542.

chicagotech’s picture

Status: Fixed » Active

I continue to have the exact same problem. I do NOT have Token Actions enabled. In rules, I have a simple rule setup to send an arbitrary e-mail to me when a node is updated, which it does. However, the token doesn't translate. The e-mail message consists of the following:

The Save As field in this posting has been changed.

User ID: [user-id]

when receiving the e-mail, that's exactly what I receive, except for the paragraph tags.

the same thing happened when I setup my first Rule reflecting the tutorial on http://drupal.org/node/298506 exactly; "user/[account:uid]" does not translate to the actual ID. My configuration includes Drupal 6.6, Content Taxonomy 6.x-1.0-beta4, FCKeditor - WYSIWYG HTML editor 6.x-2.0-alpha1, Rules 6.x-1.0-beta3 and Token 6.x-1.11.

Please help. We really need the tokens to work. Great module otherwise.

Thanks

ifoundthetao’s picture

Sire,

You might want to check out this node: http://drupal.org/node/315914

Check out #7 and you should be good to go if you know how to do some programming in PHP.

You're going to want to get the user object loaded up and good to go. That's how I did it at least, which may or may not be a good way of doing it, but it accomplished what I needed done.

fago’s picture

Status: Active » Fixed

as noted on the project page:

To get token replacements in your actions, install the latest development snapshot of token! You need a snapshot which stems from >27.08.08

I've noted that this was missing in the README, so I've added it there too.

chicagotech’s picture

Status: Fixed » Active

Thanks fago. But this still doesn't work. I downloaded this development snapshot: http://drupal.org/node/208375. It has a release date of 15 Oct. I can't tell if it stems from 27.08.08. If version this is not correct, would you please reply with a link to the dev version you mention?

I disabled Tokens, even deleted the tokens folder from 'modules', then loaded the dev version I spoke about. Token actions is not enabled and the test rule I am using is right out of the tutorial. The tutorial redirect ends up looking like this: http://test.local/users/%5Busers%3Auid%5D?destination=front_page.

A link to the correct dev snapshot or other thoughts is greatly appreciated. Thanks.

chicagotech’s picture

I think I have it working now. Thx.

ifoundthetao’s picture

Can you let us know what you did to get that? It might be helpful to someone else who has the same problem as you.

fago’s picture

Status: Active » Fixed

yes, please share what your problem was.

When you update to a recent token module, make sure to run update.php or go to the modules install page and hit submit. (This let's the cache clear, what is necessary.)

chicagotech’s picture

Fago, the solution may have been a combination of the a couple things???? Actually, the "token replacement patterns" drop down showed up and the tokens started working after I installed and played around with Friendlist (which installed a number of rules). During that time, I also disabled and re-enabled a couple modules and cleared cache. So, I can't speak to what actually kicked it in gear. I'm not controlled enough. Sorry about that. Thanks though.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

mitchell’s picture

Component: Miscellaneous » Rules Core

Updated component.