fixed signups
This commit is contained in:
parent
b4bae7460f
commit
583e1f4705
@ -152,7 +152,7 @@ export const blogRoutes = (fastify, _, done) => {
|
||||
email: req.body.email,
|
||||
site_id: req.body.site_id,
|
||||
source: req.body.source
|
||||
}).returning();
|
||||
});
|
||||
|
||||
if (inserted.rowCount != 1) {
|
||||
reply.status(400).send({
|
||||
|
@ -13,7 +13,7 @@ export async function sendFreebie(recipient, blog_id) {
|
||||
const [blog] = await db.select().from(sites).where(eq(sites.id, blog_id));
|
||||
if (!blog) throw new Error("Invalid site");
|
||||
|
||||
if (!blog.use_freebie) return;
|
||||
if (!blog.use_freebie || !blog.freebie_url) return;
|
||||
|
||||
const sender = {
|
||||
email: "mailtrap@demomailtrap.com",
|
||||
@ -32,6 +32,5 @@ export async function sendFreebie(recipient, blog_id) {
|
||||
to: recipients,
|
||||
subject: `Your freebie from ${blog.name}`,
|
||||
text: `Thank you for subscribing to ${blog.name}! Your freebie is linked below.\n ${blog.freebie_url}`,
|
||||
})
|
||||
.then(console.log, console.error);
|
||||
}).catch(console.error);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user