![]() Here are gists of each export so you can get started: The messages are also saved as entities, so you could even create a view that shows the users all of their messages. The node reference can be replaced with a form or any input that allows the user to compose the subject and body of the message. I've already used this on several sites so that administrators can send messages to users and even so other users can communicate with each other. The next page is a confirmation and the final page is the bulk operation batch that will loop through every user you selected and send them the contents of the node as an email. The following page will be a text box for entering the node id of the content that will be used for the subject and body of the message. ![]() Select the users you want to send a message to and select the operation for sending it from the bulk operations drop down. Once you're done, visit the view page that you created. Since you're using views you can add any filters for searching and filtering out the users that you want to message. Make sure you select the newly created rules component as the bulk operations action. The final step is to create a page user view that contains a views bulk operations field. Send Message with Message notify (leave all fields as default).Set a data value (set the field_message_node on the message entity to the node parameter passed to the component).Create a new entity (fill in the fields with the message type and user that the message should be assigned to).Add the following actions to your rule component.Add two required parameters to the rule component.Visit admin/config/workflow/rules/components and create a new "rule" component.Next you'll want to create a rules component that creates a new message entity, assigns it to any user on the site, and executes a message notification. Enter the token as your body (second box).Enter the token as your subject (first box).Save your field settings and switch back over to the edit tab of the message type.Create an entity reference field called "field_message_node" that references nodes and select any applicable bundles that you want to filter by (or leave unselected).Save your message type settings with any text in the required message text boxes (we'll replace later).The first on will be the message subject and the second the body. Visit admin/structure/messages and create a new message type.This allows us to send any node to any user (or group of users) as an email. In our case, we'll use an entity reference to any node and then use tokens so that the node title becomes the email subject and the node body becomes the email body. You can use the message type settings boxes to compose your subject and body directly, or you can use something like an entity reference to a node. ![]() Make sure you have message, message notify, views, views bulk operations, and rules installed on your site. I'm also including exports of each component that you can import right into the respective module for a solution out of the box. That's it! Below I give a brief step-by-step guide that requires that you're already familiar with these modules to follow. The three components that you'll need to create are a new message type, a new rules component, and a new view. After being tasked with developing a simple solution to send messages to any user or group of users on a Drupal site, I looked to views bulk operations, rules, message, and message notify module.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |