Sidecar Logo

utils/mailout.js

Created: 2025-12-12T17:15:49.631Z Modified: 2025-12-18T20:25:49.544Z

Configuration

/**
 * Sidecar Config for utils/mailout.js
 */
module.exports = {
  title: "mailout.js",
  description: "Auto-generated draft",
  created: "2025-12-12T17:15:49.631Z",
  modified: "2025-12-18T20:25:49.544Z",
};

Route Flow Map

--- title: "Route Flow: ssutil /src/utils/mailout.js " --- flowchart TD subgraph ALL ["ALL"] hono_all_recipientList_map_async__to_______________const_toName___template_toName___mustache_render_template_toName__enhancedTemplateData____to______________Build_email_object_conditionally_________const_emailParams_______________to____________to_name__toName____________from____________subject____________c__options_c________________________Add_HTML_if_template_has_HTML_________if__template_html______________emailParams_html___htmlContent________________________Add_text_if_template_has_text_________if__template_text______________emailParams_text___textContent_____________________return_await_EMAIL_SERVICES_service__emailParams___________["ALL recipientList.map(async (to) => { const toName = template.toName ? mustache.render(template.toName, enhancedTemplateData) : to; // Build email object conditionally const emailParams = { to, to_name: toName, from, subject, c: options.c }; // Add HTML if template has HTML if (template.html) { emailParams.html = htmlContent; } // Add text if template has text if (template.text) { emailParams.text = textContent; } return await EMAIL_SERVICES[service](emailParams); })"] style hono_all_recipientList_map_async__to_______________const_toName___template_toName___mustache_render_template_toName__enhancedTemplateData____to______________Build_email_object_conditionally_________const_emailParams_______________to____________to_name__toName____________from____________subject____________c__options_c________________________Add_HTML_if_template_has_HTML_________if__template_html______________emailParams_html___htmlContent________________________Add_text_if_template_has_text_________if__template_text______________emailParams_text___textContent_____________________return_await_EMAIL_SERVICES_service__emailParams___________ fill:#5E377B,color:#fff,stroke:#B4976A end extractMustacheVariables{{"extractMustacheVariables"}} style extractMustacheVariables fill:#161b22,color:#fff,stroke:#c2a35d getRandomSegment{{"getRandomSegment"}} style getRandomSegment fill:#161b22,color:#fff,stroke:#c2a35d sendEmail{{"sendEmail"}} style sendEmail fill:#161b22,color:#fff,stroke:#c2a35d prepareTemplateData{{"prepareTemplateData"}} style prepareTemplateData fill:#161b22,color:#fff,stroke:#c2a35d sendBulkEmail{{"sendBulkEmail"}} style sendBulkEmail fill:#161b22,color:#fff,stroke:#c2a35d addEmailTemplate{{"addEmailTemplate"}} style addEmailTemplate fill:#161b22,color:#fff,stroke:#c2a35d listEmailTemplates{{"listEmailTemplates"}} style listEmailTemplates fill:#161b22,color:#fff,stroke:#c2a35d getEmailTemplate{{"getEmailTemplate"}} style getEmailTemplate fill:#161b22,color:#fff,stroke:#c2a35d sendEmail --> getRandomSegment sendBulkEmail --> sendEmail linkStyle default stroke:#c2a35d,stroke-width:2px,color:#fff classDef default color:#fff

AST Code Structure

--- title: "AST Structure: ssutil /src/utils/mailout.js " --- %%{init: { 'flowchart': { 'nodeSpacing': 20, 'rankSpacing': 30 }, 'themeVariables': { 'fontSize': '11px' } } }%% graph LR n0["SF"] n2["mustache"] style n2 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 n3["ID: mustache"] n0 --> n3 n3 --> n2 style n3 stroke-dasharray:5,stroke:#B4976A n5["../apis/sendmail.js"] style n5 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n5 cursor:pointer,stroke-width:2px,stroke:#B4976A n6["ID: sendmailgun"] n0 --> n6 n6 --> n5 style n6 stroke-dasharray:5,stroke:#B4976A n8["./adf.js"] style n8 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n8 cursor:pointer,stroke-width:2px,stroke:#B4976A n9["ID: generateADFXML"] n0 --> n9 n9 --> n8 style n9 stroke-dasharray:5,stroke:#B4976A n11["../templates/xml/adf_lead_template.txt"] style n11 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n11 cursor:pointer,stroke-width:2px,stroke:#B4976A n12["ID: default"] n0 --> n12 n12 --> n11 style n12 stroke-dasharray:5,stroke:#B4976A n14["../config/common_constants.js"] style n14 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n14 cursor:pointer,stroke-width:2px,stroke:#B4976A n15["ID: ssegments"] n0 --> n15 n15 --> n14 style n15 stroke-dasharray:5,stroke:#B4976A n16["FD: extractMustacheVariables"] n0 --> n16 n364["FD: getRandomSegment"] n0 --> n364 n383["../templates/email/welcome_v4.txt"] style n383 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n383 cursor:pointer,stroke-width:2px,stroke:#B4976A n384["ID: default"] n0 --> n384 n384 --> n383 style n384 stroke-dasharray:5,stroke:#B4976A n386["../templates/email/beaconFreeWelcomeTemplate.txt"] style n386 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n386 cursor:pointer,stroke-width:2px,stroke:#B4976A n387["ID: default"] n0 --> n387 n387 --> n386 style n387 stroke-dasharray:5,stroke:#B4976A n389["../templates/email/beaconPaidWelcomeTemplate.txt"] style n389 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n389 cursor:pointer,stroke-width:2px,stroke:#B4976A n390["ID: default"] n0 --> n390 n390 --> n389 style n390 stroke-dasharray:5,stroke:#B4976A n392["../templates/email/matchlight_welcome_v1.txt"] style n392 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n392 cursor:pointer,stroke-width:2px,stroke:#B4976A n393["ID: default"] n0 --> n393 n393 --> n392 style n393 stroke-dasharray:5,stroke:#B4976A n395["../templates/email/email_beacon_lead_html.txt"] style n395 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n395 cursor:pointer,stroke-width:2px,stroke:#B4976A n396["ID: default"] n0 --> n396 n396 --> n395 style n396 stroke-dasharray:5,stroke:#B4976A n398["../templates/email/email_beacon_lead_text_v2.txt"] style n398 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n398 cursor:pointer,stroke-width:2px,stroke:#B4976A n399["ID: default"] n0 --> n399 n399 --> n398 style n399 stroke-dasharray:5,stroke:#B4976A n401["../templates/email/leads/personalize.txt"] style n401 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n401 cursor:pointer,stroke-width:2px,stroke:#B4976A n402["ID: default"] n0 --> n402 n402 --> n401 style n402 stroke-dasharray:5,stroke:#B4976A n404["../templates/email/leads/locate.txt"] style n404 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n404 cursor:pointer,stroke-width:2px,stroke:#B4976A n405["ID: default"] n0 --> n405 n405 --> n404 style n405 stroke-dasharray:5,stroke:#B4976A n407["../templates/email/leads/connect.txt"] style n407 fill:#ffffff10,stroke:#ffffff33,color:#a1a1a1 style n407 cursor:pointer,stroke-width:2px,stroke:#B4976A n408["ID: default"] n0 --> n408 n408 --> n407 style n408 stroke-dasharray:5,stroke:#B4976A subgraph sub595 ["Safe Boundary"] end n614["FD: sendEmail"] n0 --> n614 subgraph sub629 ["Safe Boundary"] end n869["FD: prepareTemplateData"] n0 --> n869 n1141["FD: sendBulkEmail"] n0 --> n1141 n1156["CE: sendEmail"] n1141 --> n1156 n1162["FD: addEmailTemplate"] n0 --> n1162 n1191["FD: listEmailTemplates"] n0 --> n1191 n1200["FD: getEmailTemplate"] n0 --> n1200 style n0 fill:#5E377B,color:#fff,stroke:#B4976A linkStyle default stroke:#c2a35d,stroke-width:1px,opacity:0.6 click n5 "../apis/sendmail.html" "View Documentation" click n8 "../utils/adf.html" "View Documentation" click n11 "../templates/xml/adf_lead_template.txt" "View Documentation" click n14 "../config/common_constants.html" "View Documentation" click n383 "../templates/email/welcome_v4.txt" "View Documentation" click n386 "../templates/email/beaconFreeWelcomeTemplate.txt" "View Documentation" click n389 "../templates/email/beaconPaidWelcomeTemplate.txt" "View Documentation" click n392 "../templates/email/matchlight_welcome_v1.txt" "View Documentation" click n395 "../templates/email/email_beacon_lead_html.txt" "View Documentation" click n398 "../templates/email/email_beacon_lead_text_v2.txt" "View Documentation" click n401 "../templates/email/leads/personalize.txt" "View Documentation" click n404 "../templates/email/leads/locate.txt" "View Documentation" click n407 "../templates/email/leads/connect.txt" "View Documentation"
CE CallExpressionFD FunctionDeclarationID ImportDeclarationSF SourceFileTS TryStatement