Mailspring/internal_packages/composer-signature/lib/signature-composer-extension.es6
Annie 848b4ef8a1 fix(signatures): Added alias to accounts rendered in dropdown
Summary:
Extended default signatures to also be associated with aliases in the signature
preference page. Also fixed some styling with the signature dropdown button in its blurred
state on the popout composer.
fix(signatures): Fixed styling for signature compuser button on popout when blurred

test(signatures): Updated tests to support and cover extending signatures to alias

Test Plan: Modified existing tests to work with these changes

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3111
2016-07-21 11:33:15 -07:00

13 lines
479 B
JavaScript

import {ComposerExtension, SignatureStore} from 'nylas-exports';
import SignatureUtils from './signature-utils';
export default class SignatureComposerExtension extends ComposerExtension {
static prepareNewDraft = ({draft}) => {
const signatureObj = draft.from && draft.from[0] ? SignatureStore.signatureForEmail(draft.from[0].email) : null;
if (!signatureObj) {
return;
}
draft.body = SignatureUtils.applySignature(draft.body, signatureObj.body);
}
}