forked from theHandsomestNerd/mixed-feelings-by-t
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contact info is not in header it is a fab
- Loading branch information
1 parent
10709e0
commit 9766f63
Showing
51 changed files
with
839 additions
and
483 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
// Download the helper library from https://www.twilio.com/docs/node/install | ||
// Find your Account SID and Auth Token at twilio.com/console | ||
// and set the environment variables. See http://twil.io/secure | ||
// const accountSid = process.env.TWILIO_ACCOUNT_SID | ||
// const authToken = process.env.TWILIO_AUTH_TOKEN | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
// const client = require("twilio")(accountSid, authToken) | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const sgMail = require("@sendgrid/mail"); | ||
import * as functions from "firebase-functions"; | ||
|
||
|
||
const sendLeadEmail = async (email: string) => { | ||
const LOG_COMPONENT = "sendgrid-client-send-lead-resume-email"; | ||
sgMail.setApiKey(process.env.SENDGRID_API_KEY); | ||
const msg = { | ||
to: email, | ||
from: process.env.SENDGRID_FROM_EMAIL, | ||
templateId: "d-175ab4190c724cb29e033711641b543b", | ||
}; | ||
|
||
functions.logger.log(LOG_COMPONENT, "NOTICE", | ||
"sending email...", msg); | ||
|
||
return sgMail | ||
.send(msg) | ||
.then(() => { | ||
console.log("Email sent"); | ||
return "Email sent"; | ||
}) | ||
.catch((error: any) => { | ||
console.error(error); | ||
return error.message; | ||
}); | ||
}; | ||
|
||
export default { | ||
sendLeadEmail, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.