Reported initially by fajerstarter in the actions usability thread, and further investigated by chx.

When you create a "Send e-mail to.." action, it will appear to fire and do everything correctly but in fact won't. The problem comes in at a drupal_mail call in system.module that looks like it was never properly updated for i18n:

  if (drupal_mail('action_send_email', $recipient, $subject, $body, $from )) {

The parameters of drupal_mail have changed, so that the first parameter is a module name. Fixing this looks to be a bit involved; I think we need to replicate what user.module is doing with its mail function....

*cough* tokens in core for 7.x *cough* ;)

Comments

anders.fajerson’s picture

I noticed that when creating the first user this error is invoked as well, but not when creating additional users as admin and checking "notify user" or registering as a user on the site.

chx’s picture

Status: Active » Needs review

At the end of the day, it's not much more than just rearranging the code already found in system_send_email_action . However, the update module docs happily ignore this little tidbit... I will do something.

chx’s picture

StatusFileSize
new3.99 KB

and the patch.

anders.fajerson’s picture

Status: Needs review » Needs work

Action now works but I still get the error when creating user 1.

webchick’s picture

Status: Needs work » Reviewed & tested by the community

Well this issue isn't to fix the user 1 creation. Probably a separate issue for that.

anders.fajerson’s picture

Ok. New issue for that: http://drupal.org/node/174224

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs review

Patch looks generally good.

- Let's have an 'implementation of hook_mail()' phpdoc on the new function.
- I would not use the subject and body variables since they need to be transformed directly anyway.
- I also don't understand why you append to $message['subject']

chx’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.04 KB
  • Sure. Added that.
  • - I would not use the subject and body variables since they need to be transformed directly anyway. <= code readibility, there'd be a huge chain of functions. Original code did exactly the same.
  • - I also don't understand why you append to $message['subject'] <= I copied user_mail. My understanding is that's your work, so...

No functionality change, the concerns addressed setting back to RTBC.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

OK, you only concatenate to an empty string and add an item to an empty array, so if that style was used, we can just as well follow that style. Thanks, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)