const personalizations = [{
to: [{ email: to }],
}];
const msg = {
personalizations,
from: {
email: fromAddress,
name: fromName,
},
subject: subject,
content: [{ type: "text/plain", value: plainText }],
};
const email = await fetch("https://api.sendgrid.com/v3/mail/send", {
body: JSON.stringify(msg),
headers: {
Authorization: `Bearer ${env.SENDGRID_API_KEY}`,
"Content-Type": "application/json",
},
method: "POST",
});
const personalizations = [{
to: [{ email: to }],
}];
const msg = {
personalizations,
from: {
email: fromAddress,
name: fromName,
},
subject: subject,
content: [{ type: "text/plain", value: plainText }],
};
const email = await fetch("https://api.sendgrid.com/v3/mail/send", {
body: JSON.stringify(msg),
headers: {
Authorization: `Bearer ${env.SENDGRID_API_KEY}`,
"Content-Type": "application/json",
},
method: "POST",
});