ooo containing html
This commit is contained in:
@@ -135,8 +135,21 @@ mailboxesRouter.get('/:email/rules', async (req, res) => {
|
||||
mailboxesRouter.put('/:email/rules', async (req, res) => {
|
||||
const email = normalizeEmail(req.params.email);
|
||||
ensureDomain(req, domainFromEmail(email));
|
||||
const body = z.object({ ooo_active: z.boolean().optional(), ooo_message: z.string().optional(), forwards: z.array(z.string().email()).optional() }).parse(req.body);
|
||||
const saved = await dynamo.putRules({ email_address: email, ooo_active: body.ooo_active, ooo_message: body.ooo_message, forwards: body.forwards });
|
||||
const body = z.object({
|
||||
ooo_active: z.boolean().optional(),
|
||||
ooo_message: z.string().optional(),
|
||||
// 'text' or 'html'. Stored as-is in DynamoDB so the email worker can
|
||||
// pick the correct Content-Type when sending the auto-reply.
|
||||
ooo_content_type: z.enum(['text', 'html']).optional(),
|
||||
forwards: z.array(z.string().email()).optional(),
|
||||
}).parse(req.body);
|
||||
const saved = await dynamo.putRules({
|
||||
email_address: email,
|
||||
ooo_active: body.ooo_active,
|
||||
ooo_message: body.ooo_message,
|
||||
ooo_content_type: body.ooo_content_type,
|
||||
forwards: body.forwards,
|
||||
});
|
||||
await audit(req.user!.email, 'mailbox.rules_update', 'mailbox', email, saved, req.ip);
|
||||
res.json(saved);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user