Closed (fixed)
Project:
Views Bulk Operations (VBO)
Version:
7.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2009 at 22:05 UTC
Updated:
9 May 2013 at 18:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
infojunkieHi Rosamunda, I take it that this is related to the first issue you sent: #406296: User views attached to node (viewfield): Send current node by email?. If it is indeed, please copy and paste the body of this issue over there and close this one. Thanks!
Comment #2
Rosamunda commentedI think it´s different (kinda), and that´s why I´ve posted it in a different issue. Anyway, it´s perfectly fine if it is considered the same thing, I will do that.
But there I´ve asked if I could (inside a certain node) send that very node to all selected users (that would be shown inside an attached view, combinig VBO with other module´s functionality).
Here I´m asking about the possibility of using the token default email option that comes within VBO, and sending all selected users in the normal default VBO way, but avoid typing the [mail] token to send them.
I´m sorry, my english isn´t quite good, maybe an example would be more clear.
I´ve created a user view that shows all registered users.
I´ve determined that view´s style as Bulk Operations.
I´ve checked only "token_actions_send_email_action" as the selected operation.
It appeared a sending email form with three fields: Recipient - Subject - Body
And then appeared the user´s list created by views with the option of selecting some or all of them.
I select some users there.
The recipients field cannot be left blank, and this is the problem that I´ve encounter:
That field actually sets the recipients of the email! So why is the benefit of selecting the view´s users? apparently none, because it will only send emails to those emails that are pasted inside the recipients field.
So, how can I avoid the need of filling that field and letting Drupal know that I want it to email all selected users.
So my question here is, how could I avoid filling the recipients´ field with [mail]?
Again, I think it´s a different question here and that maybe my sloppy english messed things up, so nobody understood what I really meant :)
Please tell me if you still think it´s the same thing. In that case I will proceed as you´ve told me.
Thanks! Sorry for the mess :)
Rosamunda
Comment #3
infojunkieThat's a different issue alright :-) I'll check this one too.
Comment #4
infojunkieThe problem is that the "token_actions_send_email_action" action is designed to be generic, so it requires the user to enter the recipient's email address.
The easiest way to solve your issue is to copy the code for that action into your own module, and to do the following modifications:
* Remove the
$form['recipient']element fromtoken_actions_send_email_action_form().* In
token_actions_send_email_action(), instead of getting the recipient as it's currently done:do the following instead:
Of course you'll need to change the action name. Hope that helps!
Comment #5
infojunkieMarking as fixed if you don't mind.
Comment #6
Rosamunda commentedSorry for not replying to this in time and SPECIALLY for not thank you properly.
It worked like a charm, THANK YOU VERY MUCH!
Yup, I really don´t mind to set this as fixed, because indeed, you´ve fixed it and I hope this helps more people as it did to me.
THANKS!
Rosamunda
Comment #8
Anonymous (not verified) commentedI'm trying to send email from the current user, but the VBO+tokenized email jus send from site_admin email. Any help?
Comment #9
Rosamunda commentedAnd that´s exactly why I´ve started this discussion in the first place. You can use the code that Karim have give us on #4.
Comment #10
mariagwyn commentedI am a little confused about how this works. Rosamunda, if you created a unique module to do this, would you mind attaching it so I can see and example? Specifically, I want to send an email (does not need to be tokenized) to users selected in a list, FROM the logged-in user, NOT the site_admin email.
Edit: I have successfully made a special module which sends emails to whomever is checked in the VBO list. however, no matter what I do to the code, the mail is sent from the site email account, not the account of the user who initiated the email. I have tried any number of things. The relevant code appears to be this:
This sets the "from":
$params['from'] = variable_get('site_mail', ini_get('sendmail_from'));I have tried to replace it with these, none work, but all send from site_mail:
$params['from'] = variable_get('user_mail', ini_get('sendmail_from'));$params['from'] = variable_get('mail', ini_get('sendmail_from'));And, creating extra places in the form for someone to manually enter an address:
$params['from'] = variable_get('from', ini_get('sendmail_from'));Any help?
Thanks, Maria
Comment #11
Anonymous (not verified) commentedtry this hack
Comment #12
mariagwyn commentedgiorez: Grazie Molto!!!
It works perfectly!!!!!! I particularly like that the entire recipient box is removed as this was an odd step for my site users. It removes the need to tell them to put "%author" in the field, which is just gibberish to most people.
I had already made a special module, so I incorporated your changes into the module, though I didn't keep all your changes (kept the longer message text, some descriptions). I have attached the file here.
Again, molti ringraziamenti!
Comment #13
mariagwyn commentedoops...attachment.
Comment #14
Anonymous (not verified) commentedis there any chance to port this into the module for an official release? I don't know how to make a patch, sorry.
Comment #15
cham74 commentedI am trying the hack in #11 and getting an error message: "Unable to send e-mail. Please contact the site administrator if the problem persists."
I need to be able to send the email to all the selected users from the logged on user and not the system email address
Comment #16
cham74 commentedTrying to use the hack in the codes above to get the user email creates a no send error for the emails. Why would this stop working id it worked before?
global $user;Comment #17
bojanz commentedThe last comment is old and talks about non-official code.
Feel free to open a new bug report if you have a reproducible problem with 6.x-1.x-dev.
Comment #18
fnapo commentedSame issue with 7.x, how can I resolve this?
No more "token_actions_send_email_action"
Comment #19
Anonymous (not verified) commentedIt seems quite impossible there is no chance 7.x to send email with vbo. any help?
Comment #20
bojanz commentedYou can use Views Send, or the email action inside a rules component.
Comment #21
Anonymous (not verified) commentedthe problem is that I need to use a Views page to send to sms and email messages. I can't create a different list for sms and email messages, so no Views Send usage. Regarding "email action inside a rules component" I don't know what you mean. Thanks a lot for helping me.