The composer lies at the heart of N1, and many improvements to the mail experience require deep integration with the composer. To enable these sort of plugins, the {DraftStore} exposes an extension API.
- Display warning messages before a draft is sent. (ie: "Are you sure you want to send this without attaching a file?")
- Intercept keyboard and mouse events to the composer's text editor.
- Transform the draft and make additional changes before it is sent.
To create your own composer extensions, subclass {DraftStoreExtension} and override the methods your extension needs.
In the sample packages repository, [templates]() is an example of a package which uses a DraftStoreExtension to enhance the composer experience.
### Example
This extension displays a warning before sending a draft that contains the names of competitors' products. If the user proceeds to send the draft containing the words, it appends a disclaimer.
```coffee
{DraftStoreExtension} = require 'nylas-exports'
class ProductsExtension extends DraftStoreExtension
@warningsForSending: (draft) ->
words = ['acme', 'anvil', 'tunnel', 'rocket', 'dynamite']