flow

Push data to external tools via email and document rendering.

flow

Flow domain — push data to external tools.

flow/email

Flow email domain — send emails to external recipients.

setProvider(provider)

Replaces the active email provider.

ParamType
providerEmailProvider

send(params) ⇒ Promise.<void>

Sends a plain-text email.

ParamTypeDescription
paramsObject
params.toArray.<string>Recipient addresses
params.subjectstringEmail subject
params.bodystringPlain-text body
[params.from]stringSender address override

Example

const { flow } = require("@beem/sdk");

await flow.email.send({
  to: ["[email protected]"],
  subject: "Report ready",
  body: "Your monthly report is available.",
});

EmailProvider : object

Properties

NameType
sendfunction

flow/documents

Flow documents domain — render documents for outbound delivery.

setProvider(provider)

Replaces the active document renderer.

ParamType
providerDocumentRenderer

render(renderFn, data) ⇒ Promise.<Buffer>

Renders a document by calling renderFn with data and the docx library, then packs to Buffer.

ParamTypeDescription
renderFnfunctionReceives (data, docxLib), returns a Document
dataany

Example

const { flow } = require("@beem/sdk");

const buffer = await flow.documents.render((data, docx) => {
  return new docx.Document({
    sections: [{ children: [new docx.Paragraph(data.title)] }],
  });
}, { title: "Monthly Report" });

DocumentRenderer : object

Properties

NameType
renderfunction