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.
| Param | Type |
|---|---|
| provider | EmailProvider |
send(params) ⇒ Promise.<void>
Sends a plain-text email.
| Param | Type | Description |
|---|---|---|
| params | Object | |
| params.to | Array.<string> | Recipient addresses |
| params.subject | string | Email subject |
| params.body | string | Plain-text body |
| [params.from] | string | Sender 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
| Name | Type |
|---|---|
| send | function |
flow/documents
Flow documents domain — render documents for outbound delivery.
setProvider(provider)
Replaces the active document renderer.
| Param | Type |
|---|---|
| provider | DocumentRenderer |
render(renderFn, data) ⇒ Promise.<Buffer>
Renders a document by calling renderFn with data and the docx library, then packs to Buffer.
| Param | Type | Description |
|---|---|---|
| renderFn | function | Receives (data, docxLib), returns a Document |
| data | any |
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
| Name | Type |
|---|---|
| render | function |
Updated 7 days ago
