Skip to content

Commit 1e83d67

Browse files
authored
feat: adds markdown support from notification payload (#57)
Signed-off-by: nitish <[email protected]>
1 parent 9b5ab6b commit 1e83d67

File tree

8 files changed

+58
-9
lines changed

8 files changed

+58
-9
lines changed

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-04-21T04:10:36Z",
6+
"generated_at": "2025-06-24T09:19:25Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -136,7 +136,7 @@
136136
"hashed_secret": "9bf92274d58c3655b80055ad2ab17540f71d3058",
137137
"is_secret": false,
138138
"is_verified": false,
139-
"line_number": 3089,
139+
"line_number": 3090,
140140
"type": "Secret Keyword",
141141
"verified_result": null
142142
}

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@ Metrics responseObj = response.getResult();
11791179
String mms = "{\"content\": \"iVBORw0KGgoAAAANSUhEUgAAAFoAAAA4CAYAAAB9lO9TAAAAAXNSR0IArs4c6QAAActpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+QWRvYmUgSW1hZ2VSZWFkeTw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3nfrHhrNNxm+032rWBb875czJMN18qtS6Qxz9yepLRlNRfPR9ijsYrS/0vdlmCghO78RZ5n3y7t2pswd1TR2Ydm0KxZ+hcVE6/YzeJ1xHDN3vxHpKFL92/TsXVK7KlN3N4Ol/v+/FXmPYtG01d4Vw2fe6vu+jh9CK7NwaQcsPWsm2Dt21XVegVl6TxdttgHMJD+DZp6Ljtqd7eN8aUY6x0RFq4LcamjtS2DT6ZS6AvIhFYcQoPDiWOOesIYdoXo6Fvf6Slfd24z/MWW0ox5whjmlBtxfCY7qdsbJu/h1gM3fHTZnC+JxhwcTeDqdKuv2/S+rSWfaLxiFzG3bIyruM1abzo6mwD1uLLB7yTtvhWrjNsaaM3kj5oc8JdiWbl3Xt5F8LtV+6F9B+QAfyu42IxPt5uO2oavO4jsoun/nF3Y7bRYttWNsbOjn6WtsbRveF3HfEVTneYTeI3ZD8RXtfQKxguyHhA3BJuBofT9AmDw+Tm9Yyxc3DC7kEXQ+TVZXhLYyRZQOpUMQ78dx27LaP0lhdHfrh6o/UBZjFz19p/Z9HoMoMPoHTtpP9IGMAP0ePbVt3HqFdLc03TI/wQfQq8dGStnuHt3VXlWvWPuxuzi0N9i4WnNtiSIj0VTeToM+p3bZhHR7drumLADmG3bQq8LZjfqZAiApIbo75x3TH7YfQJJDlmG1RsmaZzCGc4Ojd2wdLZ++EMb7AExmZs/F8rphwKFUC8in01JaZgCQPCgDAgDAgDwoAwIAwIA8KAMCAMPHUG/gKC0oz7fm25ogAAAABJRU5ErkJggg==\", \"content_type\": \"image/png\"}";
11801180
String templates = "[\"149b0e11-8a7c-4fda-a847-5d79e01b71dc\"]";
11811181
String htmlBody = "\"Hi ,<br/>Certificate expiring in 90 days.<br/><br/>Please login to <a href=\"https: //cloud.ibm.com/security-compliance/dashboard\">Security and Complaince dashboard</a> to find more information<br/>\"";
1182+
String markDown = "**Event Summary** \n\n**Toolchain ID:** `4414af34-a5c7-47d3-8f05-add4af6d78a6` \n**Content Type:** `application/json`\n\n---\n\n *Pipeline Run Details*\n\n- **Namespace:** `PR`\n- **Trigger Name:** `manual`\n- **Triggered By:** `[email protected]`\n- **Build Number:** `343`\n- **Pipeline Link:** [View Pipeline Run](https://cloud.ibm.com/devops/pipelines/tekton/e9cd5aa3-a3f2-4776-8acc-26a35922386e/runs/f29ac6f5-bd2f-4a26-abb8-4249be8dbab7?env_id=ibm:yp:us-south)";
11821183

11831184
NotificationCreate body = new NotificationCreate.Builder()
11841185
.id(InstanceID)
@@ -1195,6 +1196,7 @@ Metrics responseObj = response.getResult();
11951196
.ibmenmms(mms)
11961197
.ibmentemplates(templates)
11971198
.ibmenhtmlbody(htmlBody)
1199+
.ibmenmarkdown(markDown)
11981200
.ibmenpushto(notificationDevices)
11991201
.ibmenfcmbody(fcmJsonString)
12001202
.ibmenhuaweibody(huaweiJsonString)
@@ -1231,7 +1233,7 @@ Metrics responseObj = response.getResult();
12311233
- Pass 'WEB_FIREFOX' for Firefox browser.
12321234
- Pass 'WEB_CHROME' for Chrome browser.
12331235
- **Event Notifications SendNotificationsOptions** - Event Notifications Send Notifications method.
1234-
- **instance_id** (_string_) - Unique identifier for IBM Cloud Event Notifications instance.
1236+
- **instance_id\*** (_string_) - Unique identifier for IBM Cloud Event Notifications instance.
12351237
- **ibmenseverity** (_string_) - Severity for the notifications. Some sources can have the concept of an Event severity. Hence a handy way is provided to specify a severity of the event. example: LOW, HIGH, MEDIUM
12361238
- **id\*** (_string_) - A unique identifier that identifies each event. source+id must be unique. The backend should be able to uniquely track this id in logs and other records. Send unique ID for each send notification. Same ID can be sent in case of failure of send notification. source+id will be logged in IBM Cloud Logging service. Using this combination we will be able to trace the event movement from one system to another and will aid in debugging and tracing.
12371239
- **source\*** (_string_) - Source of the notifications. This is the identifier of the event producer. A way to uniquely identify the source of the event. For IBM Cloud services this is the crn of the service instance producing the events. For API sources this can be something the event producer backend can uniquely identify itself with.
@@ -1253,12 +1255,13 @@ Metrics responseObj = response.getResult();
12531255
- **ibmendefaultshort\*** (_string_) - Default short text for the message.
12541256
- **ibmendefaultlong\*** (_string_) - Default long text for the message.
12551257
- **specversion\*** (_string_) - Spec version of the Event Notifications. Default value is `1.0`.
1256-
- **ibmenhtmlbody\*** (_string_) - The html body of notification for email.
1257-
- **ibmenmailto\*** (_Array of string_) - Array of email ids to which the notification to be sent.
1258-
- **ibmensmsto\*** (_Array of string_) - Array of SMS numbers to which the notification to be sent.
1259-
- **ibmensmstext\*** (_string_) - SMS text to be sent.
1260-
- **ibmenslackto\*** (_Array of string_) - Array of Slack channel/member ids to which the notification to be sent.
1261-
- **ibmentemplates\*** (_Array of string_) - Array of template IDs that needs to be applied while sending notification for custom domain email and slack destination.
1258+
- **ibmenhtmlbody** (_string_) - The html body of notification for email.
1259+
- **ibmenmailto** (_Array of string_) - Array of email ids to which the notification to be sent.
1260+
- **ibmensmsto** (_Array of string_) - Array of SMS numbers to which the notification to be sent.
1261+
- **ibmensmstext** (_string_) - SMS text to be sent.
1262+
- **ibmenslackto** (_Array of string_) - Array of Slack channel/member ids to which the notification to be sent.
1263+
- **ibmentemplates** (_Array of string_) - Array of template IDs that needs to be applied while sending notification for custom domain email and slack destination.
1264+
- **ibmenmarkdown** (_string_) - The markdown content of pretty formatting.
12621265

12631266
Note: variable with \* represents the mandatory attribute.
12641267

modules/event-notifications/src/main/java/com/ibm/cloud/eventnotifications/event_notifications/v1/model/NotificationCreate.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public class NotificationCreate extends DynamicModel<Object> {
6161
protected String subject;
6262
@SerializedName("ibmenmms")
6363
protected String ibmenmms;
64+
@SerializedName("ibmenmarkdown")
65+
protected String ibmenmarkdown;
6466
@SerializedName("data")
6567
protected Map<String, Object> data;
6668
@SerializedName("datacontenttype")
@@ -112,6 +114,7 @@ public static class Builder {
112114
private String ibmenhtmlbody;
113115
private String subject;
114116
private String ibmenmms;
117+
private String ibmenmarkdown;
115118
private Map<String, Object> data;
116119
private String datacontenttype;
117120
private String ibmenpushto;
@@ -150,6 +153,7 @@ private Builder(NotificationCreate notificationCreate) {
150153
this.ibmenhtmlbody = notificationCreate.ibmenhtmlbody;
151154
this.subject = notificationCreate.subject;
152155
this.ibmenmms = notificationCreate.ibmenmms;
156+
this.ibmenmarkdown = notificationCreate.ibmenmarkdown;
153157
this.data = notificationCreate.data;
154158
this.datacontenttype = notificationCreate.datacontenttype;
155159
this.ibmenpushto = notificationCreate.ibmenpushto;
@@ -399,6 +403,17 @@ public Builder ibmenmms(String ibmenmms) {
399403
return this;
400404
}
401405

406+
/**
407+
* Set the ibmenmarkdown.
408+
*
409+
* @param ibmenmarkdown the ibmenmarkdown
410+
* @return the NotificationCreate builder
411+
*/
412+
public Builder ibmenmarkdown(String ibmenmarkdown) {
413+
this.ibmenmarkdown = ibmenmarkdown;
414+
return this;
415+
}
416+
402417
/**
403418
* Set the data.
404419
*
@@ -582,6 +597,7 @@ protected NotificationCreate(Builder builder) {
582597
ibmenhtmlbody = builder.ibmenhtmlbody;
583598
subject = builder.subject;
584599
ibmenmms = builder.ibmenmms;
600+
ibmenmarkdown = builder.ibmenmarkdown;
585601
data = builder.data;
586602
datacontenttype = builder.datacontenttype;
587603
ibmenpushto = builder.ibmenpushto;
@@ -966,6 +982,26 @@ public void setIbmenmms(final String ibmenmms) {
966982
this.ibmenmms = ibmenmms;
967983
}
968984

985+
/**
986+
* Gets the ibmenmarkdown.
987+
*
988+
* The markdown content for notification.
989+
*
990+
* @return the ibmenmarkdown
991+
*/
992+
public String getIbmenmarkdown() {
993+
return this.ibmenmarkdown;
994+
}
995+
996+
/**
997+
* Sets the ibmenmarkdown.
998+
*
999+
* @param ibmenmarkdown the new ibmenmarkdown
1000+
*/
1001+
public void setIbmenmarkdown(final String ibmenmarkdown) {
1002+
this.ibmenmarkdown = ibmenmarkdown;
1003+
}
1004+
9691005
/**
9701006
* Gets the data.
9711007
*

modules/event-notifications/src/test/java/com/ibm/cloud/eventnotifications/event_notifications/v1/EventNotificationsIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3879,6 +3879,7 @@ public void test2GSendNotifications() throws Exception {
38793879
String slackTo = "[\"C07FALXBH4G\"]";
38803880
String mms = "{\"content\": \"iVBORw0KGgoAAAANSUhEUgAAAFoAAAA4CAYAAAB9lO9TAAAAAXNSR0IArs4c6QAAActpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+QWRvYmUgSW1hZ2VSZWFkeTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KKS7NPQAABO9JREFUeAHtW81x2zoQBhgn46NLYCpISpA6cCowfYjn3ZJUELmC5Og4h0AVPKeC8HWgDh5L8DGTTMR8KxoSBCzAX3us8WKGJrg/34KfqF2AkJWSJgwIA8KAMCAMCAPCgDAgDAgDwoAw8LQZ0GfFRT2egrpcmq9zwpkGzx9RXWqllsZ8Nb7GXg+Pq83SfDm3OKlzUVy8B1mfUjYxXRZTPC65ntVKfwOZ/xfFP7Npx1afFkVx0gUTJJ91seNsjvCkXH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2oavO4jsoun/nF3Y7bRYttWNsbOjn6WtsbRveF3HfEVTneYTeI3ZD8RXtfQKxguyHhA3BJuBofT9AmDw+Tm9Yyxc3DC7kEXQ+TVZXhLYyRZQOpUMQ78dx27LaP0lhdHfrh6o/UBZjFz19p/Z9HoMoMPoHTtpP9IGMAP0ePbVt3HqFdLc03TI/wQfQq8dGStnuHt3VXlWvWPuxuzi0N9i4WnNtiSIj0VTeToM+p3bZhHR7drumLADmG3bQq8LZjfqZAiApIbo75x3TH7YfQJJDlmG1RsmaZzCGc4Ojd2wdLZ++EMb7AExmZs/F8rphwKFUC8in01JaZgCQPCgDAgDAgDwoAwIAwIA8KAMCAMPHUG/gKC0oz7fm25ogAAAABJRU5ErkJggg==\", \"content_type\": \"image/png\"}";
38813881
String htmlBody = "\"Hi ,<br/>Certificate expiring in 90 days.<br/><br/>Please login to <a href=\"https: //cloud.ibm.com/security-compliance/dashboard\">Security and Complaince dashboard</a> to find more information<br/>\"";
3882+
String markDown = "**Event Summary** \n\n**Toolchain ID:** `4414af34-a5c7-47d3-8f05-add4af6d78a6` \n**Content Type:** `application/json`\n\n---\n\n *Pipeline Run Details*\n\n- **Namespace:** `PR`\n- **Trigger Name:** `manual`\n- **Triggered By:** `[email protected]`\n- **Build Number:** `343`\n- **Pipeline Link:** [View Pipeline Run](https://cloud.ibm.com/devops/pipelines/tekton/e9cd5aa3-a3f2-4776-8acc-26a35922386e/runs/f29ac6f5-bd2f-4a26-abb8-4249be8dbab7?env_id=ibm:yp:us-south)";
38823883

38833884
NotificationCreate body = new NotificationCreate.Builder()
38843885
.id(instanceId)
@@ -3896,6 +3897,7 @@ public void test2GSendNotifications() throws Exception {
38963897
.ibmenslackto(slackTo)
38973898
.ibmenmms(mms)
38983899
.ibmenhtmlbody(htmlBody)
3900+
.ibmenmarkdown(markDown)
38993901
.ibmentemplates(templates)
39003902
.ibmenfcmbody(fcmJsonString)
39013903
.ibmenapnsbody(apnsJsonString)

modules/event-notifications/src/test/java/com/ibm/cloud/eventnotifications/event_notifications/v1/EventNotificationsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ public void testSendNotificationsWOptions() throws Throwable {
331331
.ibmenhtmlbody("testString")
332332
.subject("testString")
333333
.ibmenmms("testString")
334+
.ibmenmarkdown("testString")
334335
.data(java.util.Collections.singletonMap("anyKey", "anyValue"))
335336
.datacontenttype("application/json")
336337
.ibmenpushto("{\"platforms\":[\"push_android\", \"push_ios\", \"push_firefox\", \"push_chrome\", \"push_safari\", \"push_huawei\"]}")

modules/event-notifications/src/test/java/com/ibm/cloud/eventnotifications/event_notifications/v1/model/NotificationCreateTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public void testNotificationCreate() throws Throwable {
5151
.ibmenhtmlbody("testString")
5252
.subject("testString")
5353
.ibmenmms("testString")
54+
.ibmenmarkdown("testString")
5455
.data(java.util.Collections.singletonMap("anyKey", "anyValue"))
5556
.datacontenttype("application/json")
5657
.ibmenpushto("{\"platforms\":[\"push_android\", \"push_ios\", \"push_firefox\", \"push_chrome\", \"push_safari\", \"push_huawei\"]}")
@@ -83,6 +84,7 @@ public void testNotificationCreate() throws Throwable {
8384
assertEquals(notificationCreateModel.getIbmenhtmlbody(), "testString");
8485
assertEquals(notificationCreateModel.getSubject(), "testString");
8586
assertEquals(notificationCreateModel.getIbmenmms(), "testString");
87+
assertEquals(notificationCreateModel.getIbmenmarkdown(), "testString");
8688
assertEquals(notificationCreateModel.getData(), java.util.Collections.singletonMap("anyKey", "anyValue"));
8789
assertEquals(notificationCreateModel.getDatacontenttype(), "application/json");
8890
assertEquals(notificationCreateModel.getIbmenpushto(), "{\"platforms\":[\"push_android\", \"push_ios\", \"push_firefox\", \"push_chrome\", \"push_safari\", \"push_huawei\"]}");
@@ -119,6 +121,7 @@ public void testNotificationCreate() throws Throwable {
119121
assertEquals(notificationCreateModelNew.getIbmenhtmlbody(), "testString");
120122
assertEquals(notificationCreateModelNew.getSubject(), "testString");
121123
assertEquals(notificationCreateModelNew.getIbmenmms(), "testString");
124+
assertEquals(notificationCreateModelNew.getIbmenmarkdown(), "testString");
122125
assertEquals(notificationCreateModelNew.getData().toString(), java.util.Collections.singletonMap("anyKey", "anyValue").toString());
123126
assertEquals(notificationCreateModelNew.getDatacontenttype(), "application/json");
124127
assertEquals(notificationCreateModelNew.getIbmenpushto(), "{\"platforms\":[\"push_android\", \"push_ios\", \"push_firefox\", \"push_chrome\", \"push_safari\", \"push_huawei\"]}");

modules/event-notifications/src/test/java/com/ibm/cloud/eventnotifications/event_notifications/v1/model/SendNotificationsOptionsTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public void testSendNotificationsOptions() throws Throwable {
5252
.ibmenhtmlbody("testString")
5353
.subject("testString")
5454
.ibmenmms("testString")
55+
.ibmenmarkdown("testString")
5556
.data(java.util.Collections.singletonMap("anyKey", "anyValue"))
5657
.datacontenttype("application/json")
5758
.ibmenpushto("{\"platforms\":[\"push_android\", \"push_ios\", \"push_firefox\", \"push_chrome\", \"push_safari\", \"push_huawei\"]}")
@@ -84,6 +85,7 @@ public void testSendNotificationsOptions() throws Throwable {
8485
assertEquals(notificationCreateModel.getIbmenhtmlbody(), "testString");
8586
assertEquals(notificationCreateModel.getSubject(), "testString");
8687
assertEquals(notificationCreateModel.getIbmenmms(), "testString");
88+
assertEquals(notificationCreateModel.getIbmenmarkdown(), "testString");
8789
assertEquals(notificationCreateModel.getData(), java.util.Collections.singletonMap("anyKey", "anyValue"));
8890
assertEquals(notificationCreateModel.getDatacontenttype(), "application/json");
8991
assertEquals(notificationCreateModel.getIbmenpushto(), "{\"platforms\":[\"push_android\", \"push_ios\", \"push_firefox\", \"push_chrome\", \"push_safari\", \"push_huawei\"]}");

modules/examples/src/main/java/com/ibm/cloud/eventnotifications/event_notifications/v1/EventNotificationsExamples.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@ public static void main(String[] args) throws Exception {
22872287
String mms = "{\"url\": \"https://cloud.ibm.com/avatar/v1/avatar/migrationsegment/logo_ibm.png\"}";
22882288
String templates = "[\"149b0e11-8a7c-4fda-a847-5d79e01b71dc\"]";
22892289
String htmlBody = "\"Hi ,<br/>Certificate expiring in 90 days.<br/><br/>Please login to <a href=\"https: //cloud.ibm.com/security-compliance/dashboard\">Security and Complaince dashboard</a> to find more information<br/>\"";
2290+
String markDown = "**Event Summary** \n\n**Toolchain ID:** `4414af34-a5c7-47d3-8f05-add4af6d78a6` \n**Content Type:** `application/json`\n\n---\n\n *Pipeline Run Details*\n\n- **Namespace:** `PR`\n- **Trigger Name:** `manual`\n- **Triggered By:** `[email protected]`\n- **Build Number:** `343`\n- **Pipeline Link:** [View Pipeline Run](https://cloud.ibm.com/devops/pipelines/tekton/e9cd5aa3-a3f2-4776-8acc-26a35922386e/runs/f29ac6f5-bd2f-4a26-abb8-4249be8dbab7?env_id=ibm:yp:us-south)";
22902291

22912292
NotificationCreate body = new NotificationCreate.Builder()
22922293
.id(instanceId)
@@ -2304,6 +2305,7 @@ public static void main(String[] args) throws Exception {
23042305
.ibmenmms(mms)
23052306
.ibmentemplates(templates)
23062307
.ibmenhtmlbody(htmlBody)
2308+
.ibmenmarkdown(markDown)
23072309
.ibmenfcmbody(fcmJsonString)
23082310
.ibmenapnsbody(apnsJsonString)
23092311
.ibmenhuaweibody(huaweiJsonString)

0 commit comments

Comments
 (0)