Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Commit b9b4efa

Browse files
committed
add domain env
1 parent 153698c commit b9b4efa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/appirio/tech/core/service/identity/resource/UserResource.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ public class UserResource implements GetResource<User>, DDLResource<User> {
128128

129129
private String domain;
130130

131+
private String domainEnv;
132+
131133
private String sendgridTemplateId;
132134

133135
private String sendgridWelcomeTemplateId;
@@ -2306,6 +2308,7 @@ public String getDomain() {
23062308

23072309
public void setDomain(String domain) {
23082310
this.domain = domain;
2311+
this.domainEnv = domain.toLowerCase().contains("dev") ? "DEV" : domain.toLowerCase().contains("qa") ? "QA" : "PROD";
23092312
}
23102313

23112314
public String getSendgridTemplateId() {
@@ -2468,7 +2471,7 @@ private void sendSlackNotification(String handle, String email, String message)
24682471
ObjectMapper mapper = new ObjectMapper();
24692472
ObjectNode body = mapper.createObjectNode();
24702473
body.put("channel", diceAuth.getSlackChannelId());
2471-
body.put("text", String.format("%s%s : %s", handle, email == null ? "" : String.format(" (%s)", email) , message));
2474+
body.put("text", String.format("[%s] %s%s : %s", domainEnv, handle, email == null ? "" : String.format(" (%s)", email) , message));
24722475
try {
24732476
new Request("https://slack.com/api/chat.postMessage", "POST")
24742477
.header("Authorization", "Bearer " + diceAuth.getSlackKey())

0 commit comments

Comments
 (0)