Closed (won't fix)
Project:
Views Bulk Operations (VBO)
Version:
6.x-1.10
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Sep 2009 at 09:35 UTC
Updated:
4 Jun 2014 at 08:29 UTC
Jump to comment: Most recent
Comments
Comment #1
infojunkieWhen you select the "Send email" operation in VBO, you are prompted with the email parameters, including recipient, subject and body.
You can also pre-populate these parameters in Site configuration > Actions > Manage actions. There, select "Send email" in the "Make a new advanced action available" drop-down and fill the parameters, also giving a new name to that email-sending action. Then, in the VBO settings, select this new action. When you select the new action on the VBO view page, the parameters that you pre-entered will be used automatically.
Comment #2
vip_sa commentedI think I explained myself wrong.
I have a bunch of users on my site. I want to use VBO to send all of them an email at once. Now I have created a view with VBO that lists all the users on my site. If I select send email it doesn't give me the oppotunity to edit an email it just sends it and so I don't know what email is sent to the users. If I use the other option of sending an email it asks me to who I would like to send the email but then what is the point of using VBO because if I selecvted a bunch of people why is it still asking me for a recipient? How do I send an email to all the users of my site? That option is not available as aprt of Drupal and so that is why I thought of using VBO
Comment #3
vip_sa commentedHow do I email all the users of my website at once? That is all the people that have registered and have profiles on my site?
Comment #4
likewhoa commentedI have latest -dev and when selecting a bunch of users and selecting either "send email or send tokenized email" the email is sent to the users that's logged in not users selected in VBO. This is on drupal 6.14 and -dev modules.
Comment #5
infojunkieThis feature is available. Here's how to do it:
* Create a VBO that lists users
* Add the "Send tokenized e-mail" operation
* Select a bunch of users then press "Execute"
* In the "Set parameters for 'Send tokenized e-mail'" page, set the recipient as
[mail]* Submit
Comment #7
joachim commentedWe still have a bug here:
- What does "Send e-mail (system_send_email_action)" actually do? If it is not useful for a VBO listing users, then it should be removed in this context. If it is useful for something else, it needs a better description to say what it does, and to prevent users like myself and other commenters here misunderstanding it. At the moment, it LOOKS like what it will do is email the users I select in a user VBO, and it doesn't.
- A note in the docs on how to send emails to users in a user VBO would be useful. The string 'Send tokenized e-mail' appears nowhere in the VBO module. A google suggests this is in Rules, but it's in fact the Token Actions module.
Comment #8
joachim commentedAnd actually, something better than 'send tokenized email' action is needed.
This workflow is really non-intuitive. I can't feasibly hand this to clients. Even if they DO open the token list and make it through there, this token description is useless:
So part bug report (bad UI text) and part feature request :)
Comment #9
infojunkieAs per #644888: Usability improvements for "Send e-mail" action, you can now use the standard "Send e-mail" action which will not ask you for the recipient anymore. It's in the latest dev.
Comment #10
joachim commentedReading that patch, it seems that this improvement works for node views and adds the node authors to email actions run on views of nodes?
This is not the subject of this issue -- sending emails to users in a view of users.
Comment #11
joachim commentedActually, there is a bug here still: we have an action that appears to do something and doesn't do it. So UI needs fixing.
Comment #12
BenK commentedSubscribing...
Comment #13
joachim commentedThe best way to actually fix this would be to send the system_send_email_action the data. It actually expects a $context['recipient']; so that data could be placed into the $context quite easily by VBO.
The harder part is where to do this in views_bulk_operations_form in an extensible way. I would suggest two things:
- in VIEWS_BULK_OPS_STEP_CONFIG, give modules a chance to alter the form; and do this on behalf of system actions in this particular case
- in views_bulk_operations_form_submit, give modules a change to massage the $context data that is about to be sent to actions. And again, on behalf of system module, get the Views data and extract the user emails from it.
Comment #14
joachim commentedIn the meantime, here is a filthy hack workaround:
Comment #15
joachim commentedFor reference for anyone trying to fix this the clean way: it's complex :)
VBO tries to submit the configuration form for the action:
So if we hide the recipient field, Drupal core's send email action will choke because it has no recipient field value at all. I suppose the hacky workaround for that is to give it a dummy value and remove it again after, but that's not pretty.
You then need to get the selected users' email addresses into $operation['callback arguments']; again easier said than done --
// Execute the VBO.
$operation = $plugin->get_operation_info($form_state['storage'][VIEWS_BULK_OPS_STEP_VIEW]['operation']);
In some steps, that $form_state value is a scalar not an array!
That's as far as I got before giving up and going for the quick fix.
Comment #16
infojunkieThanks for your initiative to solve this issue.
In the latest dev, you can find the function
views_bulk_operations_form_alteraround line 389 that does something similar (which currently only works correctly for node views). You can use this as a starting point for your fix.Comment #17
joachim commentedTurns out disabling the form element breaks email sending for a reason I can't fathom.
This works:
I would suggest this as a patch on the module; though it would have to be done in regular hook_form_alter to cover the case that several VBO forms are on one page (in which case the 1 in views_bulk_operations_form__1 is not valid).
But then the check of $form['step']['#value'] might catch use of this form outside of VBO....
Comment #18
infojunkieI am postponing this until I figure out a more generic way to override actions during VBO execution.
Comment #19
goose2000 commentedjoachim,
I desperately need to implement this patch/hack. Where does this function go ?
function MYMODULE_form_views_bulk_operations_form__1_alter
Did you just write a small module to override this? Or did you add this to the VBO.module ?
I tried the tokenized email idea above, but the token didn't translate, got error:
warning: mail() [function.mail]: SMTP server response: 550 5.1.1 <[mail]>... User unknown in D:\Inetpub\wwroot\drupal_ssw_events\includes\mail.inc on line 193.
Thanks
Comment #20
Patroclas commentedThis is totally confusing.
How do I send a mass email to selected users in a view of type 'user' using 6.x-1.10 ? Is it possible or not? From my own testing it looks to be impossible, which is not good.
Comment #21
infojunkieThe module Views Send should fix mass email sending woes. I'm not attempting to fix the core email action anymore.
Comment #22
Patroclas commentedThank you! - I did not know about that module.
Thanks for your work on VBO - it's appreciated.
Comment #23
joachim commented> I'm not attempting to fix the core email action anymore.
Could the label for the core email action be changed at least, so developers don't tear their hair out trying to configure something that won't do what they want?
Comment #24
Tulika commented