Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 447cc1f5 authored by theronakpatel's avatar theronakpatel
Browse files

changes

parent ea87f26e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ class UserService {
		$sendgridAPIkey = $this->getSendGridAPIKey();
		if (empty($sendgridAPIkey)) {
			print_r("sendgrid_api_key is missing or empty.");
			die;
			$this->logger->warning("sendgrid_api_key is missing or empty.", ['app' => Application::APP_ID]);
			return;
		}
@@ -180,6 +181,7 @@ class UserService {
		$templateIDs = $this->getSendGridTemplateIDs();
		if (empty($templateIDs)) {
			print_r("welcome_sendgrid_template_ids is missing or empty.");
			die;
			$this->logger->warning("welcome_sendgrid_template_ids is missing or empty.", ['app' => Application::APP_ID]);
			return;
		}
@@ -197,6 +199,7 @@ class UserService {
			$this->sendEmailWithSendGrid($email, $sendgridAPIkey);
		} catch (Throwable $e) {
			print_r('Error sending welcome email to user: ' . $username . ': ' . $e->getMessage());
			die;
			$this->logger->error('Error sending welcome email to user: ' . $username . ': ' . $e->getMessage());
		}
	}
@@ -235,7 +238,8 @@ class UserService {
		$response = $sendgrid->send($email, [ CURLOPT_TIMEOUT => 15 ]);

		if ($response->statusCode() < 200 || $response->statusCode() > 299) {
			$this->logger->error("SendGrid API error - Status Code: " . $response->statusCode());
			print_r("SendGrid API error - Status Code: " . $response->statusCode());
			die;
		}
	}
	/**