WordPress.org

Ready to get started?Download WordPress

Forums

Private Messages For WordPress
Messages to be sent only to admins? (13 posts)

  1. planetshaker
    Member
    Posted 2 years ago #

    How do I change this so that our logged in users can write only to admins and not to each other? Thanks!!

    http://wordpress.org/extend/plugins/private-messages-for-wordpress/

  2. ANDY SCARLES
    Member
    Posted 2 years ago #

    Yes, im looking for the same thing! if you find a solution to this please reply.. (I will do the same)

    Thanks :D

  3. Opally
    Member
    Posted 2 years ago #

    I would like to see an answer to this question as well. I'm looking for a way to use private messaging as a type of user support service, strictly for communication between the registered user and the administrator.

  4. djzephyr
    Member
    Posted 1 year ago #

    I found a solution for this that works for me. In the plugin, go to inc/send-page.php and below line 183 where it says "classic way: select recipient from dropdown list" is where code needs to be added. Because I want my users to only send messages to the admin, I created an IF statement to look at the current user role and if it's an employee, only admin is displayed in the dropdown. Below is the code.

    <?php if (current_user_can('employee')) {?>
          <select name="recipient[]" size="1">
             <?php echo "<option value='admin'>Admin</option>"; ?>
          </select>
     <?php } else {?>
          <select name="recipient[]" multiple="multiple" size="5">
    	  <?php foreach ( $users as $user )
                  {$selected = ( $user->display_name == $recipient ) ? ' selected="selected"' : '';
    	      echo "<option value='$user->display_name'$selected>$user->display_name</option>";
    		}?>
          </select>
    <?php } ?>
  5. planetshaker
    Member
    Posted 1 year ago #

    Thanks for this, good idea.

  6. ferreira2u
    Member
    Posted 1 year ago #

    I'm sorry but, this plugin work for you ?

    I download the plugin, and have 2 erros:

    1) When select more than one user to send messages, on the outbox only show message sended to one user.

    2) The plugin doesn't send emails on new message.

    I use this fix http://wordpress.org/support/topic/plugin-private-messages-for-wordpress-doesnt-send-emails-on-new-message-fixed?replies=1 but don't work.

  7. Daniel King
    Member
    Posted 1 year ago #

    Hi all, I was looking for the same functionality. I wanted to list all my admins users, not just the 'admin' user, mainly because I have not an admin username.
    This is how I ended up working:

    http://pastebin.com/GhBpYsub

    I changed the original send-page.php file to query only admin users if the current user has not manage_options capabilities.

    There's a lot of room to improve it, however.

  8. Daniel King
    Member
    Posted 1 year ago #

    @ferreira2u: this plugin it's working fine for me. You should open another thread to discuss your problem. If I was you, I'll check for plugins incompatibilities.

  9. TMPTEAM
    Member
    Posted 1 year ago #

    Anyone found a solution to do?

  10. planetshaker
    Member
    Posted 1 year ago #

    @lordarkad Where exactly did you put in your code? Which line?

  11. weball-in
    Member
    Posted 1 year ago #

    Hi all,

    For the ones who are still searching for an explanation to make sure users only send an email to the admin and not to each other but give the admin the ability to send an email to which ever user he or she wants, put the following code on line 185 of the file inc/send-page.php

    elseif (current_user_can('manage_options')) { // classic way: select recipient from dropdown list?>
    
                        <?php
    						// Get all users of blog
    						$args = array(
    							'order'   => 'ASC',
    							'orderby' => 'display_name' );
    						$values = get_users( $args );
    						$values = apply_filters( 'rwpm_recipients', $values );
    						?>
    
    						<select name="recipient[]" multiple="multiple" size="5">
    							<?php
    							foreach ( $values as $value )
    							{
    								$selected = ( $value->display_name == $recipient ) ? ' selected="selected"' : '';
    								echo "<option value='$value->display_name'$selected>$value->display_name</option>";
    							}
    							?>
    						</select>
    
                        <?php } else {?>
    
                        <select name="recipient[]" size="1">
             			<?php echo "<option value='admin'>Admin</option>"; ?>
          				</select>
    
    						<?php
    					}
    					?>
  12. Toan Nguyen
    Member
    Posted 1 year ago #

    Hi Guys,
    This is a plugin send private message on wordpress, which can be used for communication, it enables users on your site to send private messages to each other, User can send private message to multiple groups (wordpress’s role) or multiple members with rich text editor – WordPress editor default, user can attach photos, files to messages.

    http://codecanyon.net/item/wp-messager-premium-wordpress-plugin/4446743

  13. QbanXpress
    Member
    Posted 1 year ago #

    @weball-in, I've implemented your code snippet but at first wasn't able to receive the messages sent to me by the subscribers even though I'm the site admin. I then realized that I had changed my admin user name via phpmyadmin. Long story short, make sure if you're gonna use weball-in's code to change the "<option value='admin'> to whatever username WordPress displays when you log in at the top right "Howdy, <username>". Thank you all for this wonderful plugin and always amazing supportive community!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags