Bladeren bron

:recycle: remove a key from Brevo declaration

dev
j 2 jaren geleden
bovenliggende
commit
b2e3f42047
1 gewijzigde bestanden met toevoegingen van 9 en 11 verwijderingen
  1. 9
    11
      backend/lib/services/user.js

+ 9
- 11
backend/lib/services/user.js Bestand weergeven

7
 const SecurePassword = require('secure-password')
7
 const SecurePassword = require('secure-password')
8
 
8
 
9
 // Configuration for Brevo
9
 // Configuration for Brevo
10
-const SibApiV3Sdk = require('@getbrevo/brevo')
11
-let apiInstance = new SibApiV3Sdk.AccountApi()
12
-apiInstance.setApiKey(
13
-    SibApiV3Sdk.AccountApiApiKeys.apiKey,
14
-    process.env.BREVO_KEY,
15
-)
16
-const sendSmtpEmail = new SibApiV3Sdk.SendSmtpEmail()
10
+const Brevo = require('@getbrevo/brevo')
11
+const apiInstance = new Brevo.TransactionalEmailsApi()
12
+const apiKey = apiInstance.authentications['api-key']
13
+apiKey.apiKey = process.env.BREVO_KEY
14
+const sendSmtpEmail = new Brevo.SendSmtpEmail()
17
 
15
 
18
 // TODO: Consider implementing, nice use of SecurePassword,
16
 // TODO: Consider implementing, nice use of SecurePassword,
19
 // but currently not used anywhere...
17
 // but currently not used anywhere...
308
             emailWasRespondedTo: false,
306
             emailWasRespondedTo: false,
309
             accessToken: null,
307
             accessToken: null,
310
         }
308
         }
311
-        // NOTE: Although this looks messy, Brevo requires these
309
+        // NOTE: Although this looks messy, Brevo requries these
312
         // parameters be defined individually like this, attempts
310
         // parameters be defined individually like this, attempts
313
-        // to configure this in a single object cause errors on their API
311
+        // to configure this in a singel object cause errors on their API
314
         sendSmtpEmail.sender = {
312
         sendSmtpEmail.sender = {
315
-            name: '[siimee]',
313
+            name: 'My Test Company',
316
             email: 'mytestemail@email.com',
314
             email: 'mytestemail@email.com',
317
         }
315
         }
318
-        sendSmtpEmail.subject = '[siimee] New Email from Siimee!'
316
+        sendSmtpEmail.subject = 'My Test Company'
319
         sendSmtpEmail.to = [
317
         sendSmtpEmail.to = [
320
             {
318
             {
321
                 email: userCredentials.email,
319
                 email: userCredentials.email,

Laden…
Annuleren
Opslaan