94 lines
2.4 KiB
JavaScript
94 lines
2.4 KiB
JavaScript
/**
|
|
* SMTP transport settings for outbound email.
|
|
*
|
|
* Protected at the global level (SiteIntegrations requires an authenticated
|
|
* user), so all fields — including the password — stay editable in the admin
|
|
* panel while remaining inaccessible to anonymous API requests.
|
|
*/ export const smtpFields = [
|
|
{
|
|
name: 'emailTransport',
|
|
type: 'select',
|
|
admin: {
|
|
description: 'How outbound email is sent. "Microsoft Graph" is only available when configured by the administrator (Intecion).'
|
|
},
|
|
defaultValue: 'smtp',
|
|
options: [
|
|
{
|
|
label: 'SMTP',
|
|
value: 'smtp'
|
|
},
|
|
{
|
|
label: 'Microsoft Graph (Exchange)',
|
|
value: 'graph'
|
|
}
|
|
]
|
|
},
|
|
{
|
|
type: 'row',
|
|
admin: {
|
|
// Hide SMTP fields when Graph is selected — they're not used then.
|
|
condition: (_, siblingData)=>siblingData?.emailTransport !== 'graph'
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'smtpHost',
|
|
type: 'text',
|
|
admin: {
|
|
placeholder: 'smtp.example.com',
|
|
width: '70%'
|
|
}
|
|
},
|
|
{
|
|
name: 'smtpPort',
|
|
type: 'number',
|
|
admin: {
|
|
width: '30%'
|
|
},
|
|
defaultValue: 587
|
|
}
|
|
]
|
|
},
|
|
{
|
|
name: 'smtpUser',
|
|
type: 'text',
|
|
admin: {
|
|
description: 'SMTP account username.'
|
|
}
|
|
},
|
|
{
|
|
name: 'smtpPassword',
|
|
type: 'text',
|
|
admin: {
|
|
description: 'SMTP account password.',
|
|
// Masked in the UI (••••) — stored plaintext, readable for SMTP auth.
|
|
components: {
|
|
Field: '@intecion/ipal-kit/client#MaskedField'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
name: 'smtpFromAddress',
|
|
type: 'email',
|
|
admin: {
|
|
description: 'Default "from" address for outgoing mail.'
|
|
}
|
|
},
|
|
{
|
|
name: 'smtpFromName',
|
|
type: 'text',
|
|
admin: {
|
|
description: 'Default "from" display name.'
|
|
}
|
|
},
|
|
{
|
|
name: 'emailTest',
|
|
type: 'ui',
|
|
admin: {
|
|
components: {
|
|
Field: '@intecion/ipal-kit/client#TestEmailButton'
|
|
}
|
|
}
|
|
}
|
|
];
|
|
|
|
//# sourceMappingURL=smtp.js.map
|