Skip to content

feat(integrations/email-notifier): add email-notifier Integration#14876

Draft
Horisofine wants to merge 21 commits intomasterfrom
hr/gto-email-notifier
Draft

feat(integrations/email-notifier): add email-notifier Integration#14876
Horisofine wants to merge 21 commits intomasterfrom
hr/gto-email-notifier

Conversation

@Horisofine
Copy link
Copy Markdown
Contributor

  • Sending capabilities using AWS SES
  • Introduced a new Email Notifier integration allowing bots to send emails.
  • Implemented actions for sending emails, including HTML formatting and error handling.
  • Added necessary configuration files, constants, and utility functions for AWS SES integration.
  • Included a README file detailing usage and setup instructions.

- Sending capabilities using AWS SES
- Introduced a new Email Notifier integration allowing bots to send emails.
- Implemented actions for sending emails, including HTML formatting and error handling.
- Added necessary configuration files, constants, and utility functions for AWS SES integration.
- Included a README file detailing usage and setup instructions.
Copy link
Copy Markdown
Contributor Author

@Horisofine Horisofine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a checklist before merging into botpress:

  • Update the Hub.md if needed
  • Remove "plus" from the integration name (in integration.definition.ts)
  • Does the integration still support old createConversation and createUser callbacks? If yes, we should either migrate to the proactive interfaces or remove the feature
  • Remove Markdown message type.
  • Does the integration still use the legacy transformer? If yes, we should migrate to the new one.
  • Is a channel named channel? If yes, is it the proper name in the external service or should use a better name?
  • Is there a bp lint disable comment? If yes, we should remove it and fix linting issue.

quu-ack added 20 commits March 12, 2026 08:14
Replace the fully inlined tsconfig.json with one that extends the shared
root ../../tsconfig.json, matching the convention used by all other
integrations. This also fixes the es2017 target drift (root uses es2022).
…ss/sdk

Replace pinned dependency versions with workspace:* protocol to stay
in sync with the monorepo, matching all other integrations.
…v dep

Add standard build, check:bplint, and test scripts to match repo
conventions. Add @botpress/cli and @botpress/sdk as devDependencies.
The monorepo uses a single root-level lockfile managed by the pnpm
workspace. No other integration has a local pnpm-lock.yaml.
Add standard eslint and vitest configuration files that extend the
shared root configs, matching all other integrations.
Add 'Marketing & Email' category so the integration appears correctly
in hub category filters, matching sendgrid and resend.
Replace 'src/definitions/index' with './src/definitions/index' for a
more explicit and standard relative import.
Remove deep import from '.botpress/implementation/typings/...' and use
inline type annotations instead. The return type is already constrained
by the bp.IntegrationProps type on the function signature.
Remove the unused empty states object from definitions and the
integration definition. Other integrations simply omit states when
they have none.
The MessageId is already narrowed by the guard on line 65
(if (!result.MessageId) throw ...), making the ! assertion unnecessary.
…eturn type

Instead of throwing a raw object literal (anti-pattern that breaks stack
traces and instanceof checks), refactor sendEmailToRecipient to return
a discriminated union { success: true, ... } | { success: false, ... }.
Replace Promise.allSettled with Promise.all since the inner function
no longer throws.
… console.log

- Remove the mutable module-level `let _ses` singleton pattern from
  client.ts; create a fresh SESv2Client on each call instead.
- Remove top-level `getSesClient()` call in utils.ts that ran at import
  time before secrets were available.
- Replace console.log with logger.forBot().warn() in addContactToList,
  passing the SES client and logger as explicit parameters.
The outer try/catch was unreachable since sendEmailToRecipient never
throws (all errors are returned as { success: false } results). Remove
it along with the unused @botpress/sdk import, and rename SESClient to
sesClient for consistent casing.
Add escapeHtml utility to prevent HTML/script injection when plain-text
user input is interpolated into email templates. In the isHtml=true
path, body is trusted as raw HTML (user intent), but the header is still
escaped. In the plain-text path, body is fully escaped before \n-to-<br>
conversion.
23 tests covering:
- escapeHtml: all 5 HTML entities, XSS payloads, edge cases
- getErrorMessage: all AWS SES exception types, generic Error, string,
  object with message, and fallback cases
Add a configuration schema with optional fromEmail and contactListName
fields that default to the previous hardcoded values ('noreply@bp-mailer.com'
and 'default'). This is non-breaking: existing users get the same
behavior, new users can override via configuration.
Replace fragile Google Drive link (drive.google.com/uc?export=view&...)
with the standard Botpress shop CDN URL already used across the codebase
(shop.botpress.com/cdn/shop/files/logo.png).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants