# "Message" button on user's admin page please?

**URL:** https://meta.discourse.org/t/message-button-on-users-admin-page-please/96143
**Category:** Feature
**Created:** [September 1, 2018, 10:38am UTC](https://meta.discourse.org/t/message-button-on-users-admin-page-please/96143 "2018-09-01T10:38:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ubik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ubik/32/89095_2.png) [@Ubik](https://meta.discourse.org/u/Ubik)
#### Post date: [September 1, 2018, 10:38am UTC](https://meta.discourse.org/t/message-button-on-users-admin-page-please/96143/1 "2018-09-01T10:38:09Z")

</div>

Could the Message button _also_ be placed on the user admin page please?

In moderation workflow, checking someone’s profile \> sending them a PM occur _often_ for a variety of reasons, and having to hop back out to the public profile is a minor bit of an ongoing annoyance.

Current:

 ![1](https://global.discourse-cdn.com/meta/original/3X/a/4/a4b35d855f3883563dd5a3038dfa1c6bcc16ed3d.jpeg)

Hoped for:

 ![2](https://global.discourse-cdn.com/meta/original/3X/4/5/45a1da28d210c3390897940d1a93991b893ae520.jpeg)

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [September 1, 2018, 12:39pm UTC](https://meta.discourse.org/t/message-button-on-users-admin-page-please/96143/2 "2018-09-01T12:39:20Z")

</div>

I will probably clean this up and make it into a theme component, but if you want to use it right away, add the following code to the `</head>` tab of the Desktop section of your main theme.

```plaintext
<script type="text/discourse-plugin" version="0.8">
  const h = require("virtual-dom").h;

  api.createWidget("user-admin-message-button", {
    tagName: "div.user-admin-message-button",

    html(attrs) {
      return h('a.btn.btn-primary.compose-pm', [h('i.fa.fa-envelope.d-icon.d-icon-envelope'), 'Message']);
    },
    
    click() {
      const container = Discourse. __container__ ;
      const Composer = require("discourse/models/composer").default;
      const composerController = container.lookup("controller:composer");
      composerController.open({
        action: Composer.PRIVATE_MESSAGE,
        usernames: this.attrs.model.username,
        archetypeId: "private_message",
        draftKey: "new_private_message"
      });
    }
  });
</script>

<script type="text/x-handlebars" data-template-name="/connectors/admin-user-controls-after/user-admin-message-button">
    {{mount-widget widget="user-admin-message-button" args=(hash model=model)}}
</script>

```

Then add this to the CSS tab of the Desktop section of your main theme:

```plaintext
.user-controls div {
    display: inline-block;
}

```

---

<div class="post-metadata">

### Author: ![Ubik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ubik/32/89095_2.png) [@Ubik](https://meta.discourse.org/u/Ubik)
#### Post date: [September 1, 2018, 1:04pm UTC](https://meta.discourse.org/t/message-button-on-users-admin-page-please/96143/3 "2018-09-01T13:04:58Z")

</div>

> [@tshenry](#):
>
> if you want to use it right away, add the following code to the `</head>` tab of the Desktop section of your main theme.

Thanks! 👍

I am a forum moderator, not admin, trying to give useful feedback from the amateur-yet-knowledgeable end of things.

I bet having to check IP/etc, then send PM, are very common mod tasks.
