Skip to main content

Quickstart

import { EmailEngineStore } from '@quik/communication';

await EmailEngineStore.get('smtp').send({
to: 'user@example.com',
subject: 'Welcome',
text: 'Hi there.'
});

Notes

  • There is no top-level Email.send() helper — engines are registered on per-channel stores (EmailEngineStore, SMSEngineStore, WhatsAppEngineStore) and resolved by name with .get(name).
  • send() is a no-op when the channel's enabled config flag is false (communication.email.enabled, communication.sms.enabled, communication.whatsapp.enabled).
  • EmailEngineStore.get(name) throws EngineNotLoadedError if no engine was registered under that name — the smtp/test email engines are only registered by module setup() when nodemailer is installed.
  • Use GetEmailEngine()/GetSMSEngine()/GetWhatsAppEngine() as class field decorators to inject the engine configured under communication.<channel>.engine without hardcoding a name.