<p>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 <ahref='draftstore.html'>DraftStore</a> exposes an extension API.</p>
<p>This API allows your package to:</p>
<ul>
<li><p>Display warning messages before a draft is sent. (ie: "Are you sure you want to send this without attaching a file?")</p>
</li>
<li><p>Intercept keyboard and mouse events to the composer's text editor.</p>
</li>
<li><p>Transform the draft and make additional changes before it is sent.</p>
</li>
</ul>
<p>To create your own composer extensions, subclass <ahref='draftstoreextension.html'>DraftStoreExtension</a> and override the methods your extension needs.</p>
<p>In the sample packages repository, <ahref="">templates</a> is an example of a package which uses a DraftStoreExtension to enhance the composer experience.</p>
<h3id="example">Example</h3>
<p>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.</p>