Skip to content

Commit 4a70bb7

Browse files
committed
Add info about consumer and remove try catch
1 parent 039c92c commit 4a70bb7

3 files changed

Lines changed: 16 additions & 21 deletions

File tree

config/monolog.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ monolog:
99
type: stream
1010
path: "%kernel.logs_dir%/%kernel.environment%.user_com.log"
1111
level: debug
12-
channels: ["user_com"]
12+
channels: ["user_com", "messenger"]
1313
firephp:
1414
type: firephp
1515
level: info

doc/installation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,8 @@
6161
enabled: true
6262
```
6363
7. Add api credentials to your channel configuration in admin panel. If you decided to extend different object, please make sure that api credentials are set
64-
64+
8. Configure consumer to run in supervisor or crontab:
65+
```bash
66+
bin/console messenger:consume user_com_asynchronous
67+
```
6568
8. While integrating with User.com via GTM, you can use `user_com_customer_info` in browser console to check currently logged in customer data.

src/Manager/CustomerUpdateManager.php

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,23 @@ public function manageChange(
3535
?string $email = null,
3636
?string $userKey = null,
3737
): array|null {
38-
try {
39-
if (null !== $userKey) {
40-
return $this->customerWithKeyUpdater->updateWithUserKey(
41-
$eventName,
42-
$userKey,
43-
$apiAwareResource,
44-
$customer,
45-
$address,
46-
$email,
47-
);
48-
}
49-
50-
return $this->customerWithoutKeyUpdater->updateWithoutUserKey(
38+
if (null !== $userKey) {
39+
return $this->customerWithKeyUpdater->updateWithUserKey(
5140
$eventName,
41+
$userKey,
5242
$apiAwareResource,
5343
$customer,
5444
$address,
5545
$email,
5646
);
57-
} catch (\Throwable $exception) {
58-
$this->logger->error('User.com - Customer request failed.', [
59-
'exception' => $exception,
60-
]);
61-
62-
return null;
6347
}
48+
49+
return $this->customerWithoutKeyUpdater->updateWithoutUserKey(
50+
$eventName,
51+
$apiAwareResource,
52+
$customer,
53+
$address,
54+
$email,
55+
);
6456
}
6557
}

0 commit comments

Comments
 (0)