MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / sendTemplate

Function sendTemplate

apps/api/src/lib/email/email.dispatch.ts:63–85  ·  view source on GitHub ↗
(
  input: ISendTemplateInput
)

Source from the content-addressed store, hash-verified

61 * never requires changing call sites.
62 */
63export const sendTemplate = async (
64 input: ISendTemplateInput
65): Promise<ISendOutcome> => {
66 if (env.QUEUES_ENABLED) {
67 const manager = getQueueManager();
68
69 if (manager !== null) {
70 await manager.enqueueEmailDelivery(input);
71
72 return { status: "queued" };
73 }
74
75 logger.warn(
76 "QUEUES_ENABLED=true but QueueManager is not initialized; sending inline",
77 {
78 event: "queue_fallback_inline",
79 templatePath: input.templatePath,
80 }
81 );
82 }
83
84 return sendTemplateNow(input);
85};

Callers 10

registerMethod · 0.90
changeMethod · 0.90
requestMethod · 0.90
completeMethod · 0.90
sendLifecycleEmailMethod · 0.90
resendMethod · 0.90

Calls 4

getQueueManagerFunction · 0.90
sendTemplateNowFunction · 0.85
enqueueEmailDeliveryMethod · 0.80
warnMethod · 0.80

Tested by

no test coverage detected