mirror of
https://github.com/documenso/documenso.git
synced 2025-11-18 10:42:01 +10:00
chore: refactor sendMail to make it reusable
This commit is contained in:
@ -8,9 +8,13 @@ import { ZSendMailMutationSchema } from './schema';
|
||||
export const mailRouter = router({
|
||||
send: authenticatedProcedure.input(ZSendMailMutationSchema).mutation(async ({ input }) => {
|
||||
try {
|
||||
const { email } = input;
|
||||
|
||||
return await sendMail({ email });
|
||||
return await sendMail({
|
||||
template: input,
|
||||
mail: {
|
||||
from: '<hi@documenso>',
|
||||
subject: 'Documeso Invite',
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user