Skip to content

Commit b4815c5

Browse files
authored
Update contact.js (#125)
1 parent 97f794e commit b4815c5

1 file changed

Lines changed: 38 additions & 38 deletions

File tree

functions/contact.js

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -145,41 +145,41 @@ const sendEmailWithMailgun = async (
145145
return response;
146146
};
147147

148-
const sendEmailWithSendGrid = async (
149-
env,
150-
name,
151-
email,
152-
subject,
153-
message,
154-
domain
155-
) => {
156-
const url = env.SENDGRID_API_URI;
157-
const body = JSON.stringify({
158-
personalizations: [
159-
{
160-
to: [{ email: env.SENDGRID_TO_EMAIL, name: env.SENDGRID_TO_NAME }],
161-
subject: `${name} - ${subject}`,
162-
},
163-
],
164-
from: { email: env.SENDGRID_FROM_EMAIL, name: env.SENDGRID_FROM_NAME },
165-
reply_to: { email: email, name: name },
166-
content: [
167-
{
168-
type: "text/html",
169-
value: formatEmailBody(name, email, subject, message, domain),
170-
},
171-
],
172-
});
173-
174-
const options = {
175-
method: "POST",
176-
headers: {
177-
Authorization: `Bearer ${env.SENDGRID_API_KEY}`,
178-
"Content-Type": "application/json",
179-
},
180-
body: body,
181-
};
182-
183-
const response = await sendRequest(url, options);
184-
return response;
185-
};
148+
// const sendEmailWithSendGrid = async (
149+
// env,
150+
// name,
151+
// email,
152+
// subject,
153+
// message,
154+
// domain
155+
// ) => {
156+
// const url = env.SENDGRID_API_URI;
157+
// const body = JSON.stringify({
158+
// personalizations: [
159+
// {
160+
// to: [{ email: env.SENDGRID_TO_EMAIL, name: env.SENDGRID_TO_NAME }],
161+
// subject: `${name} - ${subject}`,
162+
// },
163+
// ],
164+
// from: { email: env.SENDGRID_FROM_EMAIL, name: env.SENDGRID_FROM_NAME },
165+
// reply_to: { email: email, name: name },
166+
// content: [
167+
// {
168+
// type: "text/html",
169+
// value: formatEmailBody(name, email, subject, message, domain),
170+
// },
171+
// ],
172+
// });
173+
174+
// const options = {
175+
// method: "POST",
176+
// headers: {
177+
// Authorization: `Bearer ${env.SENDGRID_API_KEY}`,
178+
// "Content-Type": "application/json",
179+
// },
180+
// body: body,
181+
// };
182+
183+
// const response = await sendRequest(url, options);
184+
// return response;
185+
// };

0 commit comments

Comments
 (0)