-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a3467f
commit 463de0f
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ import { useForm } from 'react-hook-form'; | |
import { Button } from '@/components/ui/button'; | ||
import { | ||
Form, | ||
FormControl, | ||
FormControl, FormDescription, | ||
FormField, | ||
FormItem, | ||
FormLabel, | ||
|
@@ -25,6 +25,7 @@ import InfoDialog from '@/components/ui/info-hover'; | |
const formSchema = z.object({ | ||
fromAddress: z.string().email(), | ||
projectmanagerAddress: z.string().email(), | ||
fromName: z.string().optional(), | ||
}); | ||
|
||
export default function ProjectSettingsNotifications() { | ||
|
@@ -36,6 +37,7 @@ export default function ProjectSettingsNotifications() { | |
const defaults = useCallback( | ||
() => ({ | ||
fromAddress: data?.emailConfig?.[category]?.fromAddress || null, | ||
fromName: data?.emailConfig?.[category]?.fromName || '', | ||
projectmanagerAddress: | ||
data?.emailConfig?.[category]?.projectmanagerAddress || null, | ||
}), | ||
|
@@ -57,6 +59,7 @@ export default function ProjectSettingsNotifications() { | |
[category]: { | ||
fromAddress: values.fromAddress, | ||
projectmanagerAddress: values.projectmanagerAddress, | ||
fromName: values.fromName, | ||
}, | ||
}); | ||
if (project) { | ||
|
@@ -110,6 +113,23 @@ export default function ProjectSettingsNotifications() { | |
</FormItem> | ||
)} | ||
/> | ||
<FormField | ||
control={form.control} | ||
name="fromName" | ||
render={({ field }) => ( | ||
<FormItem> | ||
<FormLabel> | ||
Wil je een naam toevoegen aan het e-mailadres waarvandaan de notificaties worden verstuurd? | ||
<InfoDialog content={'Let op: dit werkt alleen als de domeininstellingen voor dit e-mailadres correct geconfigureerd zijn. Tip: maak hiervoor gebruik van Flowmailer of Sendgrid.'} /> | ||
</FormLabel> | ||
<FormDescription>Als je hier een naam invult komt dit voor het e-mailadres van de afzender te staan, bijvoorbeeld: OpenStad site <[email protected]></FormDescription> | ||
<FormControl> | ||
<Input placeholder="" {...field} /> | ||
</FormControl> | ||
<FormMessage /> | ||
</FormItem> | ||
)} | ||
/> | ||
<FormField | ||
control={form.control} | ||
name="projectmanagerAddress" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters