@vasrefil/api-toolkit 1.0.61 → 1.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,17 +15,21 @@ class GoMailerUtil_ {
15
15
  const { req, actionType } = dto.serviceResponse;
16
16
  const url = 'https://automata.go-mailer.com/api/v1/events/trigger';
17
17
  const user = req.user;
18
+ const transaction = req.transaction;
18
19
  const body = {
19
20
  event_code: actionType,
20
21
  contact_email: user.email,
21
22
  context: {
22
23
  firstname: user.first_name,
23
24
  lastname: user.last_name,
25
+ conversion_value: transaction?.amount || 0,
26
+ transaction_type: transaction?.type || '',
27
+ transaction_service_type: transaction?.service_type || '',
28
+ transaction_date: transaction?.createdAt ? Date.parse(transaction?.createdAt) : 0
24
29
  }
25
30
  };
26
31
  const headers = { Authorization: `Bearer ${env_1.default.GO_MAILER.API_KEY}` };
27
- const { data } = await axios_1.default.post(url, body, { headers });
28
- console.log('data', data);
32
+ await axios_1.default.post(url, body, { headers });
29
33
  }
30
34
  catch (error) {
31
35
  const err = helpers_1.RequestHelper.get_error(error);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vasrefil/api-toolkit",
3
3
  "description": "This is Vasrefil API toolkit",
4
- "version": "1.0.61",
4
+ "version": "1.0.62",
5
5
  "author": "Sodiq Alabi",
6
6
  "main": "dist/public-api.js",
7
7
  "types": "dist/public-api.d.ts",