5

I would like the users on a site to be able to select certain nodes and send a list of those nodes to one specific e-mail address.

Gathering the nodes is easy with Nodequeue or Flags, so is sending a mail with Action when a node is flagged. The problem is sending an email with the list when the user want to, when the list is final.

Do you know any solid solution for this problem?

4 Answers 4

2
+50

If you don't have a custom module created yet, make one (always good to have at least one custom module for misc tasks).

Create a menu callback for sending the node information in you hook_menu().

function hook_menu(){
  return array(
    'user/%/sendNodes'=>array(
      'type'=>MENU_CALLBACK,
      'page callback' => 'hook_send_nodes',
      'page arguments' => array(1),
    ),
  );
}

Create the callback function to send the nodes.

function hook_send_nodes($uid){
  // Fetch all flagged nodes from database for this $uid.
  // Send this node information through drupal_mail(). 
  // After your nodes have been sent, use drupal_goto().     
}

So now, you can create a link to the URL user/UID/sendNodes and that will send the nodes. Obviously this is all pseudo-code, but the idea is there.

1
  • That was the kind of answer I was looking for, thank you. It will take some time for me to figure it out (small experience with module dev) but I think that is the solution for me. Thanks again. Sep 18, 2012 at 10:09
1

I don't know a posible way with a module.

Wha I will do is this.

In a module I will build a form to send the nodes. To build this module Only need hook_perm hook_menu a form with a submit button. Flag to all the modules you want to send. Hook_mail to send the mail with the nodes. And take a look at flag to "un -flag" all the nodes sends by that person.

It's not easy, and you have to build you own module

Oskar

0

I think your idea is the best one.

You can take a look at newsletter, and use rules to send the newsletter to a e-mail. Also can use views into the newsletter to get all the nodequeue.

Oskar

3
  • That still doesn't solve the problem, which is how to allow the user to send the list when she wants. I can set it up so every single addition to the list gets emailed but that's not a good way to do this. I need a solution where a user can gather lots of nodes, create a list and when she wants, when the list is ready to send, she can send it to an email address in one e-mail. Sep 10, 2012 at 10:45
  • Bálint you can build a button to send the list of nodes. If you solve how to make the list, send them it's really esasy. Sep 15, 2012 at 9:16
  • 1
    You can also create a menu entry, with a custom callback, so that if you add a link to, for example, "/send-nodes-to-mail", the callback gets nodes from flags, or nodequeue, and send it via mail.
    – arrubiu
    Sep 16, 2012 at 20:23
0

Have you tried with Views Send module ?

Create a view and add at least one column containing e-mail addresses.

Create a "Page" display and set the style to "Bulk Operations". On "Bulk Operations" style configuration, under "Selected operations", select Send mass mail (views_send_mail_action). For Drupal 7 Add the "Global: Send E-mail" field to your view. This field provides the checkboxes that allow the user to select multiple rows.

Create a "Page" (or "Block") display. Save the view, load the page, use exposed filters to build the list, select all or some rows and choose "Send mass mail".

Fill the message form to configure the E-mail. Use tokens to personalize your E-mail. The module provide also row-based tokens, taken from the current row of the view. For example, if the view has a column with the key users_name (the user name) you can use this replacement token [views-send-users_name]. Preview and send the message.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.