mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
12 lines
479 B
JavaScript
12 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);
|
|
}
|
|
}
|