Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions packages/connectors/connector-smtp2go-email/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 1.0.0 (2026-01-30)

### Features

* **connector:** add SMTP2GO email connector ([#xxxx](https://github.com/logto-io/logto/pull/xxxx))

Initial release of the SMTP2GO email connector for Logto.

**Supported features:**
- Email sending via SMTP2GO API v3
- Template-based email system
- Support for plain text and HTML emails
- Custom i18n template support
- Handlebar variable replacement
- All standard Logto email templates (Register, SignIn, ForgotPassword, Generic, etc.)
122 changes: 122 additions & 0 deletions packages/connectors/connector-smtp2go-email/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# SMTP2GO email connector

The official Logto connector for SMTP2GO email service.

**Table of contents**

- [SMTP2GO email connector](#smtp2go-email-connector)
- [Get started](#get-started)
- [Register SMTP2GO account](#register-smtp2go-account)
- [Verify senders](#verify-senders)
- [Create API keys](#create-api-keys)
- [Configure your connector](#configure-your-connector)
- [Test SMTP2GO email connector](#test-smtp2go-email-connector)
- [Config types](#config-types)

## Get started

SMTP2GO is a reliable email delivery service for transactional and marketing emails. We can use its email sending function to send _verification codes_.

## Register SMTP2GO account

Create a new account at [SMTP2GO website](https://www.smtp2go.com/). You may skip this step if you've already got an account.

## Verify senders

Go to the [SMTP2GO dashboard](https://app.smtp2go.com/) and sign in with your SMTP2GO account.

Senders indicate the addresses our verification code email will be sent from. In order to send emails via SMTP2GO, you need to verify at least one sender email address or domain.

From the SMTP2GO dashboard, navigate to **Settings β†’ Sender Domains** or **Settings β†’ Verified Senders**.

**Domain Verification (Recommended):**
- Click "Add Domain" and follow the instructions to verify your entire domain
- You'll need to add DNS records (SPF, DKIM) to your domain
- This allows you to send from any email address on that domain

**Single Sender Verification:**
- Click "Add Verified Sender"
- Enter the email address you want to send from
- SMTP2GO will send a verification email to that address
- Click the verification link in the email to complete the process

## Create API keys

From the [SMTP2GO dashboard](https://app.smtp2go.com/), navigate to **Settings β†’ API Keys**.

Click **Add API Key** button:
1. Give your API key a descriptive name (e.g., "Logto Production")
2. Select the appropriate permissions (at minimum, "Send Email" permission is required)
3. Click "Create"

**Important:** The API key will be shown only once. Copy it immediately and store it securely.

## Configure your connector

Fill out the `apiKey` field with the API Key created in the "Create API keys" section.

Fill out the `sender` field with your verified sender email address (e.g., `noreply@yourdomain.com`).

Fill out the `senderName` field with a friendly name that will appear as the sender (e.g., "Logto"). This field is OPTIONAL.

You can add multiple SMTP2GO email connector templates for different cases. Here is an example of adding a single template:

- Fill out the `subject` field, which works as the title of emails.
- Fill out the `content` field with arbitrary string-typed contents. Do not forget to leave placeholders like `{{code}}` for the random verification code.
- Fill out `usageType` field with either `Register`, `SignIn`, `ForgotPassword`, `Generic` for different use cases.
- Fill out `type` field with either `text/plain` or `text/html` for different types of content.

In order to enable full user flows, templates with usageType `Register`, `SignIn`, `ForgotPassword` and `Generic` are required.

Here is an example of SMTP2GO connector template JSON:

```jsonc
[
{
"subject": "Welcome to Logto - Verify Your Account",
"content": "Your verification code is {{code}}. This code will expire in 10 minutes.",
"usageType": "Register",
"type": "text/plain"
},
{
"subject": "Sign in to Logto",
"content": "Your sign-in verification code is {{code}}. This code will expire in 10 minutes.",
"usageType": "SignIn",
"type": "text/plain"
},
{
"subject": "Reset Your Logto Password",
"content": "Your password reset code is {{code}}. This code will expire in 10 minutes.",
"usageType": "ForgotPassword",
"type": "text/plain"
},
{
"subject": "Logto Verification Code",
"content": "Your verification code is {{code}}. This code will expire in 10 minutes.",
"usageType": "Generic",
"type": "text/plain"
}
]
```

### Test SMTP2GO email connector

You can type in an email address and click on "Send" to see whether the settings can work before "Save and Done".

That's it. Don't forget to [Enable connector in sign-in experience](https://docs.logto.io/docs/recipes/configure-connectors/email-connector/enable-email-sign-in/)

### Config types

| Name | Type |
|------------|-------------------|
| apiKey | string |
| sender | string |
| senderName | string (OPTIONAL) |
| templates | Template[] |

| Template Properties | Type | Enum values |
|---------------------|-------------|------------------------------------------------------|
| subject | string | N/A |
| content | string | N/A |
| usageType | enum string | 'Register' \| 'SignIn' \| 'ForgotPassword' \| 'Generic' |
| type | enum string | 'text/plain' \| 'text/html' |
67 changes: 67 additions & 0 deletions packages/connectors/connector-smtp2go-email/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# SMTP2GO Email Connector

## Overview

The SMTP2GO connector enables Logto to send transactional emails through the SMTP2GO email delivery service. This connector supports all standard Logto email templates including registration, sign-in, password reset, and more.

## Features

- βœ… Support for both plain text and HTML emails
- βœ… Template-based email sending
- βœ… Custom i18n template support
- βœ… Handlebar variable replacement (e.g., `{{code}}`, `{{link}}`)
- βœ… Verified sender support

## Prerequisites

1. An active SMTP2GO account ([Sign up here](https://www.smtp2go.com/))
2. A verified sender email address or domain
3. An SMTP2GO API key with "Send Email" permissions

## Configuration

See the main [README.md](../README.md) for detailed setup instructions.

### Required Configuration

- **apiKey**: Your SMTP2GO API key
- **sender**: Your verified sender email address
- **templates**: Array of email templates for different use cases

### Optional Configuration

- **senderName**: Friendly name to display as the email sender

## API Reference

This connector uses the SMTP2GO `/v3/email/send` API endpoint. For more information, see the [SMTP2GO API documentation](https://apidoc.smtp2go.com/documentation/).

## Development

### Install Dependencies

```bash
pnpm install
```

### Run Tests

```bash
pnpm test
```

### Build

```bash
pnpm build
```

### Development Mode

```bash
pnpm dev
```

## License

MPL-2.0
8 changes: 8 additions & 0 deletions packages/connectors/connector-smtp2go-email/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions packages/connectors/connector-smtp2go-email/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "@logto/connector-smtp2go-email",
"version": "1.0.0",
"description": "SMTP2GO Email Service connector implementation.",
"author": "Fabio Lorenzo <fabio.lorenzo@lomus.ch>",
"dependencies": {
"@logto/connector-kit": "workspace:^",
"@silverhand/essentials": "^2.9.1",
"got": "^14.0.0",
"zod": "3.24.3"
},
"main": "./lib/index.js",
"module": "./lib/index.js",
"exports": "./lib/index.js",
"license": "MPL-2.0",
"type": "module",
"files": [
"lib",
"docs",
"logo.svg",
"logo-dark.svg"
],
"scripts": {
"precommit": "lint-staged",
"check": "tsc --noEmit",
"build": "tsup",
"dev": "tsup --watch",
"lint": "eslint --ext .ts src",
"lint:report": "pnpm lint --format json --output-file report.json",
"test": "vitest src",
"test:ci": "pnpm run test --silent --coverage",
"prepublishOnly": "pnpm build"
},
"engines": {
"node": "^22.14.0"
},
"eslintConfig": {
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@silverhand/eslint-config": "6.0.1",
"@silverhand/ts-config": "6.0.0",
"@types/node": "^22.14.0",
"@types/supertest": "^6.0.2",
"@vitest/coverage-v8": "^3.1.1",
"eslint": "^8.56.0",
"lint-staged": "^15.0.2",
"nock": "^14.0.3",
"prettier": "^3.5.3",
"supertest": "^7.0.0",
"tsup": "^8.5.0",
"typescript": "^5.5.3",
"vitest": "^3.1.1"
}
}
Loading
Loading