Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
27b3e9f
feat: add smtp action (#20)
nicosammito Jul 24, 2026
4dd4d2d
feat: add smtp action (#20) - index, helpers, functions, registration
nicosammito Jul 24, 2026
7c65ca4
fix: renamed multiple things to pass minimum character limit of 3
MarlonLange Aug 4, 2026
41dbe4b
feat: added received and sent trigger
MarlonLange Aug 4, 2026
f2e16f2
fix: renamed the name of the action
MarlonLange Aug 8, 2026
5dd6a19
fix: fixed sending mails and removed unnecessary trigger
MarlonLange Aug 8, 2026
df52180
feat: removed creating attachment, files selected for attachments
MarlonLange Aug 14, 2026
86ba5d6
feat: filename is added from file object and updated hercules
MarlonLange Sep 1, 2026
3d9004a
feat: add smtp action (#20)
nicosammito Jul 24, 2026
dd7e9b7
feat: add smtp action (#20) - index, helpers, functions, registration
nicosammito Jul 24, 2026
e82be32
fix: renamed multiple things to pass minimum character limit of 3
MarlonLange Aug 4, 2026
e795d43
feat: added received and sent trigger
MarlonLange Aug 4, 2026
fa11b4d
fix: fixed sending mails and removed unnecessary trigger
MarlonLange Aug 8, 2026
eca4d43
feat: removed creating attachment, files selected for attachments
MarlonLange Aug 14, 2026
c138ae0
feat: filename is added from file object and updated hercules
MarlonLange Sep 1, 2026
e0fb8e3
feat: upgrade hercules
MarlonLange Sep 24, 2026
06173d5
feat: new package-lock.json
nicosammito Sep 24, 2026
b2cc4b5
fix: removed unecessary schemas
MarlonLange Oct 1, 2026
77d5047
feat: simplify attachment handling in sendEmailWithAttachmentsFunction
nicosammito Oct 24, 2026
1923e81
feat: enhance SmtpSendResultSchema validation by adding from and to f…
nicosammito Oct 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ include:
- shopware-action
- twilio-action
- stripe-action
- smtp-action

.rust-actions:
- cron-action
- rest-action
- mcp-action
- smtp-action

test-node:
image: node:24.10.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The "central" place for all actions — a monorepo containing integrations provi
|--------|-------------|
| [GLS](docs/Actions/GLS/overview.md) | GLS ShipIT integration for creating and managing shipments |
| [Stripe](actions/stripe-action/README.md) | Stripe payments integration for managing customers, payment intents and refunds |

| SMTP | Send emails (with attachments) through any SMTP server via nodemailer |
## ENV

All actions share the following base environment variables, which connect them to the Hercules/Aquila infrastructure:
Expand Down
3 changes: 3 additions & 0 deletions actions/smtp-action/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.env
node_modules/
dist/
13 changes: 13 additions & 0 deletions actions/smtp-action/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:24.10.0-alpine

WORKDIR /app

COPY package.json package-lock.json* ./

RUN npm install

COPY . .

RUN npm run build

CMD ["npm", "run", "start"]
61 changes: 61 additions & 0 deletions actions/smtp-action/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# SMTP Action

Send emails through any SMTP server from a Hercules flow. Built on
[nodemailer](https://nodemailer.com/), the de-facto standard SMTP client for
Node.js.

This action is function-only (like the GLS and Twilio actions) — it exposes
functions to send mail and build attachments, and does not register any
triggers.

## Configuration

Configured via the action's `ConfigurationDefinition`s:

| Identifier | Type | Required | Description |
|---|---|---|---|
| `host` | TEXT | yes | Hostname of the SMTP server, e.g. `smtp.example.com`. |
| `port` | TEXT | no (default `587`) | SMTP port. Common values: `587` (STARTTLS), `465` (implicit TLS). |
| `secure` | TEXT | no (default `false`) | `"true"` to use implicit TLS (port 465), `"false"` for STARTTLS (port 587). |
| `username` | TEXT | no | Username for SMTP AUTH. Leave empty for unauthenticated relays. |
| `password` | TEXT | no | Password for SMTP AUTH. |
| `from_address` | TEXT | no | Default `From` used when a function call omits it, e.g. `Acme <no-reply@example.com>`. |

Beyond the shared Hercules variables (`HERCULES_AUTH_TOKEN`,
`HERCULES_AQUILA_URL`, `HERCULES_ACTION_ID`, `HERCULES_SDK_VERSION`), no
provider-specific environment variables are required — SMTP credentials are
supplied through the configuration above.

## Functions

| Identifier | Signature | Description |
|---|---|---|
| `sendEmail` | `(To, Subject, Text, Html?, From?, Cc?, Bcc?, ReplyTo?): SMTP_SEND_RESULT` | Send a plain-text (and optionally HTML) email. `To`/`Cc`/`Bcc` are comma-separated address lists. |
| `sendEmailWithAttachments` | `(To, Subject, Text, Attachments, Html?, From?, Cc?, Bcc?): SMTP_SEND_RESULT` | Send an email with one or more attachments built via `createAttachment`. |
| `createAttachment` | `(Filename, Content, ContentType?, Encoding?): SMTP_ATTACHMENT` | Build an attachment object. Use `base64` encoding for binary files. |

## Data types

- `SMTP_SEND_RESULT` — normalized nodemailer `SentMessageInfo`: `messageId`,
`accepted`, `rejected`, `response`, `envelope`.
- `SMTP_ENVELOPE` — the SMTP envelope (`from`, `to`) used for delivery.
- `SMTP_ATTACHMENT` — `filename`, `content`, optional `contentType` and
`encoding`.

## Provider setup

Most providers (Gmail, Microsoft 365, Amazon SES, Postmark, Mailgun, etc.)
expose SMTP credentials. For Gmail/Workspace you typically need an
[App Password](https://support.google.com/accounts/answer/185833) rather than
your account password. Point `host`/`port` at the provider's SMTP endpoint and
set `secure` to match the port (465 → `true`, 587 → `false`).

## Development

```bash
cd actions/smtp-action
npm install
npm run typecheck
npm run build
npm run test
```
Loading
Loading