feat(#55): Add error check for Brevo API key

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Josh Creek
2024-11-02 15:28:37 +00:00
committed by GitHub
parent 1250261afe
commit 26426f9804
+3
View File
@@ -7,6 +7,9 @@ import {
const apiInstance = new brevo.TransactionalEmailsApi();
const apiKey = apiInstance.authentications['apiKey'];
if (!VITE_BREVO_API_KEY) {
throw new Error('Brevo API key is not configured');
}
apiKey.apiKey = VITE_BREVO_API_KEY;
const sendEmail = async (subject: string, htmlContentString: string, toAddress: string) => {