|
|
@@ -7,13 +7,11 @@ const Schmervice = require('@hapipal/schmervice')
|
|
7
|
7
|
const SecurePassword = require('secure-password')
|
|
8
|
8
|
|
|
9
|
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
|
16
|
// TODO: Consider implementing, nice use of SecurePassword,
|
|
19
|
17
|
// but currently not used anywhere...
|
|
|
@@ -308,14 +306,14 @@ module.exports = class UserService extends Schmervice.Service {
|
|
308
|
306
|
emailWasRespondedTo: false,
|
|
309
|
307
|
accessToken: null,
|
|
310
|
308
|
}
|
|
311
|
|
- // NOTE: Although this looks messy, Brevo requires these
|
|
|
309
|
+ // NOTE: Although this looks messy, Brevo requries these
|
|
312
|
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
|
312
|
sendSmtpEmail.sender = {
|
|
315
|
|
- name: '[siimee]',
|
|
|
313
|
+ name: 'My Test Company',
|
|
316
|
314
|
email: 'mytestemail@email.com',
|
|
317
|
315
|
}
|
|
318
|
|
- sendSmtpEmail.subject = '[siimee] New Email from Siimee!'
|
|
|
316
|
+ sendSmtpEmail.subject = 'My Test Company'
|
|
319
|
317
|
sendSmtpEmail.to = [
|
|
320
|
318
|
{
|
|
321
|
319
|
email: userCredentials.email,
|