import type { ConnectorMetadata } from '@logto/connector-kit'; import { ConnectorConfigFormItemType } from '@logto/connector-kit'; export const defaultMetadata: ConnectorMetadata = { id: 'simple-mail-transfer-protocol', target: 'smtp', platform: null, name: { en: 'SMTP', 'zh-CN': 'SMTP', 'tr-TR': 'SMTP', ko: 'SMTP', }, logo: './logo.svg', logoDark: null, description: { en: 'The SMTP is an internet standard communication protocol for electronic mail transmission.', 'zh-CN': 'SMTP 是简单邮件通讯协议的缩写,可对接所有邮件服务提供商。', 'tr-TR': 'SMTP, elektronik posta iletimi için internet standart iletişim protokolüdür.', ko: 'SMTP는 이메일 전송을 위한 표준 통신 규약 입니다.', }, readme: './README.md', formItems: [ { key: 'host', label: 'Host', type: ConnectorConfigFormItemType.Text, required: true, placeholder: '', }, { key: 'port', label: 'Port', type: ConnectorConfigFormItemType.Number, required: true, placeholder: '25', }, { key: 'auth', label: 'Auth', type: ConnectorConfigFormItemType.Json, required: true, defaultValue: { type: 'login', user: '', pass: '', }, }, { key: 'fromEmail', label: 'From Email', type: ConnectorConfigFormItemType.Text, required: true, placeholder: '', }, { key: 'replyTo', label: 'Reply To', type: ConnectorConfigFormItemType.Text, required: false, placeholder: '', }, { key: 'templates', label: 'Templates', type: ConnectorConfigFormItemType.Json, required: true, defaultValue: [ { contentType: 'text/plain', content: 'Your Logto sign-in verification code is {{code}}. The code will remain active for 10 minutes.', subject: 'Logto Sign In with SMTP', usageType: 'SignIn', }, { contentType: 'text/plain', content: 'Your Logto sign-up verification code is {{code}}. The code will remain active for 10 minutes.', subject: 'Logto Register with SMTP', usageType: 'Register', }, { contentType: 'text/plain', content: 'Your Logto password change verification code is {{code}}. The code will remain active for 10 minutes.', subject: 'Logto Forgot Password with SMTP', usageType: 'ForgotPassword', }, { contentType: 'text/plain', content: 'Your Logto verification code is {{code}}. The code will remain active for 10 minutes.', subject: 'Logto Generic with SMTP', usageType: 'Generic', }, ], }, { key: 'logger', label: 'Logger', type: ConnectorConfigFormItemType.Switch, required: false, defaultValue: false, }, { key: 'debug', label: 'Debug', type: ConnectorConfigFormItemType.Switch, required: false, defaultValue: false, }, { key: 'disableFileAccess', label: 'Disable File Access', type: ConnectorConfigFormItemType.Switch, required: false, defaultValue: false, }, { key: 'disableUrlAccess', label: 'Disable URL Access', type: ConnectorConfigFormItemType.Switch, required: false, defaultValue: false, }, { key: 'name', label: 'Name', type: ConnectorConfigFormItemType.Text, required: false, placeholder: '', }, { key: 'localAddress', label: 'Local Address', type: ConnectorConfigFormItemType.Text, required: false, placeholder: '', }, { key: 'connectionTimeout', label: 'Connection Timeout', type: ConnectorConfigFormItemType.Number, required: false, placeholder: '2 * 60 * 1000 (default is 2 minutes)', }, { key: 'greetingTimeout', label: 'Greeting Timeout', type: ConnectorConfigFormItemType.Number, required: false, placeholder: '30 * 1000 (default is 30 seconds)', }, { key: 'socketTimeout', label: 'Socket Timeout', type: ConnectorConfigFormItemType.Number, required: false, placeholder: '10 * 60 * 1000 (default is 10 minutes)', }, { key: 'dnsTimeout', label: 'DNS Timeout', type: ConnectorConfigFormItemType.Number, required: false, placeholder: '30 * 1000 (default is 30 seconds)', }, { key: 'secure', label: 'Secure', type: ConnectorConfigFormItemType.Switch, required: true, defaultValue: false, }, { key: 'tls', label: 'TLS', type: ConnectorConfigFormItemType.Json, required: false, defaultValue: {}, showConditions: [{ targetKey: 'secure', expectValue: true }], }, { key: 'servername', label: 'Servername', type: ConnectorConfigFormItemType.Text, required: false, placeholder: '', showConditions: [{ targetKey: 'secure', expectValue: true }], }, { key: 'ignoreTLS', label: 'Ignore TLS', type: ConnectorConfigFormItemType.Switch, required: false, showConditions: [{ targetKey: 'secure', expectValue: true }], }, { key: 'requireTLS', label: 'Require TLS', type: ConnectorConfigFormItemType.Switch, required: false, showConditions: [{ targetKey: 'secure', expectValue: true }], }, ], };