# New-message composer URL reuses recipients from draft

**URL:** https://meta.discourse.org/t/new-message-composer-url-reuses-recipients-from-draft/72114
**Category:** Bug
**Created:** [15.Октябрь.2017 21:06:55 UTC](https://meta.discourse.org/t/new-message-composer-url-reuses-recipients-from-draft/72114 "2017-10-15T21:06:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![flesser](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flesser/32/80524_2.png) [@flesser](https://meta.discourse.org/u/flesser)
#### Post date: [15.Октябрь.2017 21:06:55 UTC](https://meta.discourse.org/t/new-message-composer-url-reuses-recipients-from-draft/72114/1 "2017-10-15T21:06:55Z")

</div>

We are using the tips from [Customize email notification footer with links to reply privately and see user profiles](https://meta.discourse.org/t/email-notification-footer-with-links-for-reply-privately-sender-profile-and-user-profile/50305) on our installation to encourage users to reply by PM instead of publicly if only the sender is concerned.

However, sometimes the To: field of the PM is pre-filled with the wrong username, even though the one in the URL is correct.

It seems like composing PMs by URL reuses a previously unfinished PM instead of starting a clean new one. The `title` and `body` URL properties (silently) override the unfinished message’s values, but `username` doesn’t. (Which should be intended behaviour in my opinion).

**Steps to reproduce:**

1. click on a link to compose a new PM by URL:  
[https://discourse.example.com/new-message?username=user1&title=Title1&body=Body1](https://discourse.example.com/new-message?username=user1&title=Title1&body=Body1)

2. close the compose popup without sending the PM

3. click on another link to compose a PM to a different user:  
[https://discourse.example.com/new-message?username=user2&title=Title2&body=Body2](https://discourse.example.com/new-message?username=user2&title=Title2&body=Body2)

**Actual behaviour:**

The compose popup opens, recipient still set to `user1`, but title and body updated to the “Title2” and “Body2” values from the URL.

(Also, if on the second link one of the parameters `title` or `body` is not set, the old values from the previous message appear instead of the intended empty string.)

**Expected behaviour:**

- The compose popup opens with `user2` as recipient. (Maybe also showing a warning that the previously unfinished message was discarded.)
- If `title` or `body` are not set in the URL, those fields in the PM should be empty, too.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [18.Январь.2018 01:20:52 UTC](https://meta.discourse.org/t/new-message-composer-url-reuses-recipients-from-draft/72114/2 "2018-01-18T01:20:52Z")

</div>

Any tips here @techAPJ?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [18.Январь.2018 02:04:32 UTC](https://meta.discourse.org/t/new-message-composer-url-reuses-recipients-from-draft/72114/3 "2018-01-18T02:04:32Z")

</div>

I am not able to repro this here on meta. Seems like it’s fixed now.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [18.Январь.2018 02:08:13 UTC](https://meta.discourse.org/t/new-message-composer-url-reuses-recipients-from-draft/72114/4 "2018-01-18T02:08:13Z")

</div>


