1

I'm using Drupal 7 Privatemsg module. To prefill the message body, I use the following hook but don't get anything displayed.

function MyModule_privatemsg_message_view_alter(&$vars) {
  module_load_include('pages.inc','privatemsg');

  $vars['message']['body'] = "<i>Dear Friend</i>,\n <strong>you rock!</strong>";
}

Any help ?

0

One solution is to use the Prepopulate module and then customize the URL to send a privatemsg. This works well if you are using Views to generate the links, for example.

|improve this answer|||||
  • I tried to use the URL but /message/new returns Access Denied even for admin – postgres83 Feb 17 '16 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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