Community Documentation

Prepopulating Private Message fields

Last updated June 5, 2009. Created by parrottvision on June 5, 2009.
Log in to edit this page.

If you are trying to pre-populate the private message fields this how to do it. Like the drupal body field there is an array called privatemsg which needs to go first.

e.g.

http://yoursite.com/messages/new?edit[privatemsg][recipient]=name&edit[privatemsg][subject]=subject line

To get the just the text name in the recipient I put this as recipient

<?php
print strip_tags($name);
?>

Comments

Note that for recipient and

Note that for recipient and subject, you don't need prepopulate.module at all. Just use an URL like this:

.. messages/new/1,2,3/subject

Where 1,2,3 is a comma separated list of user id's.

Also, the [privatemsg] part isn't necessary anymore in Privatemsg 6.x-2.x

About this page

Drupal version
Drupal 6.x
Audience
Developers and coders, Themers

Site Building Guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.