graph + mail dispatcher, test-email endpoint, notifications global

This commit is contained in:
2026-08-22 17:55:43 +02:00
parent 3d8bc9019f
commit ac48f1e9d1
40 changed files with 1336 additions and 13 deletions
@@ -8,8 +8,30 @@ import type { Field } from 'payload'
* panel while remaining inaccessible to anonymous API requests.
*/
export const smtpFields: Field[] = [
{
name: 'emailTransport',
type: 'select',
admin: {
description:
'How outbound email is sent. "Microsoft Graph" is only available when configured by the administrator (Intecion).',
// The Graph option only makes sense when agency credentials exist in env.
// We can't read process.env in the admin UI directly, so a client project
// that hasn't set up Graph should filter this option via integrationsFields
// override, or simply leave it on 'smtp'. The adapter enforces the real
// availability at send time regardless of what's selected here.
},
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',
@@ -56,4 +78,13 @@ export const smtpFields: Field[] = [
description: 'Default "from" display name.',
},
},
{
name: 'emailTest',
type: 'ui',
admin: {
components: {
Field: '@intecion/ipal-kit/client#TestEmailButton',
},
},
},
]