Skip to content

Commit

Permalink
Merge pull request #868 from appwrite/fix-messaging-smtp-provider
Browse files Browse the repository at this point in the history
Fix messaging smtp provider
  • Loading branch information
TorstenDittmann authored Feb 24, 2024
2 parents 1544ec6 + 644a67b commit 264af34
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@
fromEmail: $providerData.options['fromEmail'],
replyToName: $providerData.options['replyToName'],
replyToEmail: $providerData.options['replyToEmail'],
encryption: $providerData.options['encryption'],
encryption: !$providerData.options['encryption']
? 'none'
: $providerData.options['encryption'],
autoTLS: $providerData.options['autoTLS'],
mailer: $providerData.options['mailer']
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@
formValues['password'] || undefined,
formValues['encryption'],
formValues['autoTLS'],
undefined,
formValues['fromName'] || undefined,
formValues['fromEmail'],
formValues['replyToName'] || undefined,
formValues['replyToEmail'] || undefined,
undefined
formValues['replyToEmail'] || undefined
);
break;
case Providers.FCM:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
InputText,
InputPassword
} from '$lib/elements/forms';
import InputCheckbox from '$lib/elements/forms/inputCheckbox.svelte';
import PopoverContent from './popoverContent.svelte';
import type {
ProviderInput,
Expand Down Expand Up @@ -122,6 +123,12 @@
{input.description}
</svelte:fragment>
</InputSwitch>
{:else if input.type === 'checkbox'}
<InputCheckbox label={input.label} id={input.name} bind:checked={params[input.name]}>
<svelte:fragment slot="description">
{input.description}
</svelte:fragment>
</InputCheckbox>
{:else if input.type === 'select'}
<InputSelect
label={input.label}
Expand Down
23 changes: 18 additions & 5 deletions src/routes/console/project-[project]/messaging/providers/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ export const columns = writable<Column[]>([
export type ProviderInput = {
label: string;
name: string;
type: 'text' | 'password' | 'phone' | 'email' | 'domain' | 'file' | 'switch' | 'select';
type:
| 'text'
| 'password'
| 'phone'
| 'email'
| 'domain'
| 'file'
| 'switch'
| 'select'
| 'checkbox';
placeholder?: string;
description?: string;
popover?: string[];
Expand Down Expand Up @@ -317,7 +326,7 @@ export const providers: ProvidersMap = {
label: 'Server host',
name: 'host',
type: 'text',
placeholder: 'Enter host'
placeholder: 'smtp.server.com'
},
{
label: 'Server port',
Expand Down Expand Up @@ -353,16 +362,20 @@ export const providers: ProvidersMap = {
{
label: 'Auto TLS',
name: 'autoTLS',
description: 'Automatically uses TLS encryption',
type: 'switch',
description: 'Automatically uses TLS encryption if available.',
type: 'checkbox',
optional: true
},
{
label: 'Mailer',
name: 'mailer',
type: 'text',
optional: true,
placeholder: 'Enter mailer'
placeholder: 'Enter mailer',
popover: [
'<b>What is the Mailer?</b>',
'The value to use for the X-Mailer header.'
]
}
]
}
Expand Down

0 comments on commit 264af34

Please sign in to comment.