- Introduced a new contract for script returns, requiring an object with `output`, `context`, and `skipRemaining` fields. - Refactored existing scripts to align with the new return structure, ensuring compatibility with the updated context management. - Added utility functions for normalizing context and step results, improving the handling of script execution context. - Updated various scripts (e.g., fetch-binary, fetch-html, fetch-http) to return structured output and context, enhancing data flow and usability. - Improved error handling for script returns, ensuring clearer feedback when invalid structures are returned. This update significantly enhances the flexibility and clarity of script interactions within workflows.
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: send-gmail
|
|
description: |
|
|
Send email via Gmail SMTP. Configure user/from and the named secret,
|
|
then call from other workflows with trigger-workflow.js (name: send-gmail).
|
|
|
|
Input (data):
|
|
to optional recipient(s); defaults to your Gmail below
|
|
subject required
|
|
text plain body (aliases: body, message)
|
|
html optional HTML body
|
|
from, cc, bcc, replyTo, priority, headers optional
|
|
scripts:
|
|
- script: jsonata.js
|
|
config:
|
|
expression: |
|
|
{
|
|
"to": $exists(data.to) ? data.to : "nasyarobby@gmail.com",
|
|
"from": data.from,
|
|
"subject": data.subject,
|
|
"text": $exists(data.text) ? data.text : ($exists(data.body) ? data.body : data.message),
|
|
"html": data.html,
|
|
"cc": data.cc,
|
|
"bcc": data.bcc,
|
|
"replyTo": data.replyTo,
|
|
"priority": data.priority,
|
|
"headers": data.headers
|
|
}
|
|
- script: send-email.js
|
|
config:
|
|
service: Gmail
|
|
user: elevent16th@gmail.com
|
|
from: elevent16th@gmail.com
|
|
passwordSecret: gmail_app_password
|
|
triggers:
|
|
- type: workflow
|
|
- type: HTTP
|
|
method: POST
|
|
path: /send-gmail
|