I have a few views set up with bulk operations where certain people can send emails to say all the people playing in a league. The Send Email action works great except these people aren't Drupal experts by any means and having to enter tokens for recipients is a pain.

On view its [registration:user:mail] and another it might by [user:mail]

What would be awesome if there was a way so that when I create send email vbo action that I can set the recipient. For this purpose I don't care if this can be overridden or even displayed on the form.

For now, I'm working around this on a case by case basis in a hook_form_alter

if ($form_id == 'views_form_league_registrations_default') {
    if (isset($form['recipient'])) {
      $form['recipient']['#default_value'] = '[registration:user:mail]';
    }
  } else if ($form_id == 'views_form_search_players_page') {
    if (isset($form['recipient'])) {
      $form['recipient']['#default_value'] = '[user:mail]';
    }
  }

Comments

bkat created an issue. See original summary.

joelpittet’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
Category: Bug report » Feature request

This sounds like a cool idea, want to submit a patch?