fix: remove isPersonalEmail logic
This commit is contained in:
@@ -12,7 +12,7 @@ nodemailerTransporter().then((t) => {
|
||||
});
|
||||
|
||||
async function sendWithNodemailer(emailData) {
|
||||
const { from, to, subject, content, isPersonalEmail, replyTo } = emailData;
|
||||
const { from, to, subject, content, replyTo } = emailData;
|
||||
|
||||
if (!transporter) {
|
||||
return;
|
||||
@@ -74,7 +74,6 @@ emailRouter.post('/', async (req, res) => {
|
||||
to: zod.string(),
|
||||
subject: zod.string(),
|
||||
content: zod.string(),
|
||||
isPersonalEmail: zod.boolean().optional(),
|
||||
replyTo: zod.string().optional()
|
||||
})
|
||||
);
|
||||
@@ -88,7 +87,7 @@ emailRouter.post('/', async (req, res) => {
|
||||
let res;
|
||||
|
||||
try {
|
||||
if (emailData.isPersonalEmail || !ZOHO_TOKEN) {
|
||||
if (!ZOHO_TOKEN) {
|
||||
res = await sendWithNodemailer(emailData);
|
||||
} else {
|
||||
res = await sendWithZoho(emailData);
|
||||
|
||||
@@ -30,7 +30,6 @@ const sendEmailNotification = async (feedId: string, authorId: string, comment?:
|
||||
<a class="button" href="${postLink}">View comment</a>
|
||||
</div>
|
||||
`,
|
||||
isPersonalEmail: false,
|
||||
replyTo: 'noreply@classroomio.com'
|
||||
}
|
||||
];
|
||||
|
||||
@@ -44,6 +44,7 @@ export async function POST({ request }) {
|
||||
|
||||
const emailData = [
|
||||
{
|
||||
from: `"Best from ClassroomIO" <notify@mail.classroomio.com>`,
|
||||
to: email,
|
||||
subject: `Join ${name} on ClassroomIO 😃`,
|
||||
content: `
|
||||
@@ -52,8 +53,7 @@ export async function POST({ request }) {
|
||||
<div>
|
||||
<a class="button" href="${inviteLink}">Accept Invitation</a>
|
||||
</div>
|
||||
`,
|
||||
isPersonalEmail: true
|
||||
`
|
||||
}
|
||||
];
|
||||
await sendEmail(emailData);
|
||||
|
||||
@@ -37,6 +37,7 @@ export async function POST({ request }) {
|
||||
|
||||
const emailData = [
|
||||
{
|
||||
from: `"Best from ClassroomIO" <notify@mail.classroomio.com>`,
|
||||
to,
|
||||
subject: 'Action Required: Confirm your email',
|
||||
content: `
|
||||
@@ -47,8 +48,7 @@ export async function POST({ request }) {
|
||||
<div>
|
||||
<a class="button" href="${verificationLink}">Verify</a>
|
||||
</div>
|
||||
`,
|
||||
isPersonalEmail: true
|
||||
`
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ export async function POST({ request }) {
|
||||
|
||||
const emailData = [
|
||||
{
|
||||
from: `"Best from ClassroomIO" <notify@mail.classroomio.com>`,
|
||||
to,
|
||||
subject: 'Welcome to ClassroomIO!',
|
||||
content: `
|
||||
@@ -44,8 +45,7 @@ export async function POST({ request }) {
|
||||
<p>
|
||||
PS: I reply personally to every email. We don't have an outsourced support team at the other end of the globe.. ;-)
|
||||
</p>
|
||||
`,
|
||||
isPersonalEmail: true
|
||||
`
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user