Mailspring/internal_packages/composer-signature/lib/signature-composer-extension.es6
Ben Gotow 94badcda15 es6(*): convert 20+ source files used in example packages to ES2016
There could be a few lurking bugs. Please test!
2016-02-29 18:47:22 -08:00

13 lines
456 B
JavaScript

import {ComposerExtension} from 'nylas-exports';
import SignatureUtils from './signature-utils';
export default class SignatureComposerExtension extends ComposerExtension {
static prepareNewDraft = ({draft})=> {
const accountId = draft.accountId;
const signature = NylasEnv.config.get(`nylas.account-${accountId}.signature`);
if (!signature) {
return;
}
draft.body = SignatureUtils.applySignature(draft.body, signature);
}
}