Skip to content

Commit

Permalink
Make public static methods contingent on setting PUSH_API_KEY/PUSH_AP…
Browse files Browse the repository at this point in the history
…I_URL. Make inner sendPush() method package scope.
  • Loading branch information
JymDyerIBI committed Aug 31, 2023
1 parent 38660e6 commit 17ba7fb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class NotificationUtils {
*/
public static String sendPush(OtpUser otpUser, String textTemplate, Object templateData) {
// If Push API config properties aren't set, do nothing.
if (PUSH_API_KEY.equals(null) || PUSH_API_URL.equals(null)) return null;
if (PUSH_API_KEY == null || PUSH_API_URL == null) return null;
try {
String body = TemplateUtils.renderTemplate(textTemplate, templateData);
String toUser = otpUser.email;
Expand Down Expand Up @@ -286,7 +286,7 @@ public static boolean sendEmailViaSparkpost(
*/
public static int getPushInfo(String toUser) {
// If Push API config properties aren't set, no info can be obtained.
if (PUSH_API_KEY.equals(null) || PUSH_API_URL.equals(null)) return 0;
if (PUSH_API_KEY == null || PUSH_API_URL == null) return 0;
try {
Map<String, String> headers = Map.of("Accept", "application/json");
var httpResponse = HttpUtils.httpRequestRawResponse(
Expand Down

0 comments on commit 17ba7fb

Please sign in to comment.