22
33namespace common \components ;
44
5- use Sil \EmailService \Client \EmailServiceClient ;
5+ use Sil \Idp \IdBroker \Client \EmailServiceClientException ;
6+ use Sil \Idp \IdBroker \Client \IdBrokerClient ;
67use yii \base \Component ;
78
89class Emailer extends Component
@@ -14,7 +15,7 @@ class Emailer extends Component
1415 */
1516 public $ emailServiceConfig = [];
1617
17- /** @var EmailServiceClient */
18+ /** @var IdBrokerClient */
1819 protected $ emailServiceClient = null ;
1920
2021 /**
@@ -43,7 +44,7 @@ protected function assertConfigIsValid()
4344 ];
4445
4546 foreach ($ requiredParams as $ param ) {
46- if (! isset ($ this ->emailServiceConfig [$ param ])) {
47+ if (!isset ($ this ->emailServiceConfig [$ param ])) {
4748 throw new \InvalidArgumentException (
4849 'Missing email service configuration for ' . $ param ,
4950 1502311757
@@ -60,7 +61,7 @@ protected function assertConfigIsValid()
6061 * @param string $htmlBody The email body (as HTML).
6162 * @param string $textBody The email body (as plain text).
6263 * @param null|string $ccAddress The cc email address.
63- * @throws \Sil\EmailService\Client\ EmailServiceClientException
64+ * @throws EmailServiceClientException
6465 */
6566 public function email (
6667 string $ toAddress ,
@@ -79,18 +80,18 @@ public function email(
7980 }
8081
8182 /**
82- * @return EmailServiceClient
83- * @throws \Sil\EmailService\Client\ EmailServiceClientException
83+ * @return IdBrokerClient
84+ * @throws EmailServiceClientException
8485 */
8586 protected function getEmailServiceClient ()
8687 {
8788 if ($ this ->emailServiceClient === null ) {
88- $ this ->emailServiceClient = new EmailServiceClient (
89+ $ this ->emailServiceClient = new IdBrokerClient (
8990 $ this ->emailServiceConfig ['baseUrl ' ],
9091 $ this ->emailServiceConfig ['accessToken ' ],
9192 [
92- EmailServiceClient:: ASSERT_VALID_IP_CONFIG => $ this ->emailServiceConfig ['assertValidIp ' ],
93- EmailServiceClient ::TRUSTED_IPS_CONFIG => $ this ->emailServiceConfig ['validIpRanges ' ],
93+ IdBrokerClient:: ASSERT_VALID_BROKER_IP_CONFIG => $ this ->emailServiceConfig ['assertValidIp ' ],
94+ IdBrokerClient ::TRUSTED_IPS_CONFIG => $ this ->emailServiceConfig ['validIpRanges ' ],
9495 ]
9596 );
9697 }
0 commit comments