# Issue open pre-filled composer

**URL:** <https://meta.discourse.org/t/issue-open-pre-filled-composer/82979>\
**Category:** Development\
**Created:** [March 14, 2018, 2:48pm UTC](https://meta.discourse.org/t/issue-open-pre-filled-composer/82979 "2018-03-14T14:48:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Osama](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osama/32/98013_2.png) [@Osama](https://meta.discourse.org/u/Osama)\
**Post date:** [March 14, 2018, 6:59pm UTC](https://meta.discourse.org/t/issue-open-pre-filled-composer/82979/2 "2018-03-14T18:59:09Z")

</div>

You could do something like this in your button’s action:

```plaintext
const { CREATE_TOPIC, DRAFT } = require('discourse/models/composer').default;

composer = Discourse. __container__.lookup('controller:composer');
composer.open({
  action: CREATE_TOPIC,
  draftKey: DRAFT,
  title: "Pre-filled topic title!",
  topicBody: "Pre-filled topic body goes here"
});

```

You can pass additional data to the composer’s `open()` method such as tags, category ID, target usernames if you’re sending a message and so on. There are a lot of clues in this file:

[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/controllers/composer.js.es6#L587](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/controllers/composer.js.es6#L587)

---

_[View the full topic](https://meta.discourse.org/t/issue-open-pre-filled-composer/82979)._
