noahdelaweb
Explore posts from serversCDCloudflare Developers
•Created by noahdelaweb on 11/21/2024 in #pages-help
Your Worker exceeded the size limit of 1 MiB. Re
@Walshy i will have about 300 user in my site, should i get 5 or 25 ?
7 replies
CDCloudflare Developers
•Created by noahdelaweb on 11/21/2024 in #pages-help
Your Worker exceeded the size limit of 1 MiB. Re
7 replies
CDCloudflare Developers
•Created by noahdelaweb on 8/17/2023 in #general-help
Failed to produce a Cloudflare Pages build from the project.
it still give me the same error
16 replies
CDCloudflare Developers
•Created by noahdelaweb on 8/17/2023 in #general-help
Failed to produce a Cloudflare Pages build from the project.
like so ?
import nodemailer from "nodemailer";
import sgTransport from "nodemailer-sendgrid-transport";
const transporter = {
auth: {
// Update your SendGrid API key here
api_key: "...",
},
};
const mailer = nodemailer.createTransport(sgTransport(transporter));
// Add the config object for Edge Runtime
export const config = { runtime: 'edge' };
export default async (req, res) => {
// console.log(req.body)
const { name, email, number, subject, text } = req.body;
const data = {
// Update your email here
to: "[email protected]",
from: email,
subject: "Hi there",
text: text,
html:
<b>From:</b> ${name} <br />
<b>Number:</b> ${number} <br />
<b>Subject:</b> ${subject} <br />
<b>Message:</b> ${text}
,
};
try {
const response = await mailer.sendMail(data);
console.log(response);
res.status(200).send("Email send successfully");
} catch (error) {
console.log(error);
res.status(500).send("Error proccessing charge");
}
};16 replies