Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions apps/comms/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,33 @@ vars:
app: comms

tasks:
gql:
dir: ./internal/app
cmds:
- go run github.com/99designs/gqlgen generate
- gofmt -w -d -r '"errors" -> "github.com/kloudlite/api/pkg/errors"' graph/*.resolvers.go

k8s-schema:
cmds:
- mkdir -p "./internal/app/_struct-to-graphql"
- go run ../../cmd/struct-to-graphql
--struct github.com/kloudlite/api/apps/comms/internal/domain/entities.NotificationConf
--struct github.com/kloudlite/api/apps/comms/internal/domain/entities.Subscription
--struct github.com/kloudlite/api/apps/comms/types.Notification
--struct github.com/kloudlite/api/pkg/types.Pagination
--struct github.com/kloudlite/api/pkg/repos.MatchFilter
--struct github.com/kloudlite/api/pkg/repos.CursorPagination
> ./internal/app/_struct-to-graphql/main.go
- |+
pushd ./internal/app/_struct-to-graphql
go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Notification
popd
- rm -rf ./internal/app/_struct-to-graphql


gen:constants:
cmds:
- go generate ./internal/domain/entities/field-constants/gen.go
run:
dotenv: [".secrets/env"]
cmds:
Expand Down
186 changes: 186 additions & 0 deletions apps/comms/email-templates/alert/email.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">

<head>
<title>
</title>
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
#outlook a {
padding: 0;
}

body {
margin: 0;
padding: 0;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}

table,
td {
border-collapse: collapse;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}

img {
border: 0;
height: auto;
line-height: 100%;
outline: none;
text-decoration: none;
-ms-interpolation-mode: bicubic;
}

p {
display: block;
margin: 13px 0;
}
</style>
<!--[if mso]>
<noscript>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
</noscript>
<![endif]-->
<!--[if lte mso 11]>
<style type="text/css">
.mj-outlook-group-fix { width:100% !important; }
</style>
<![endif]-->
<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700);
@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
</style>
<!--<![endif]-->
<style type="text/css">
@media only screen and (min-width:480px) {
.mj-column-per-100 {
width: 100% !important;
max-width: 100%;
}
}
</style>
<style media="screen and (min-width:480px)">
.moz-text-html .mj-column-per-100 {
width: 100% !important;
max-width: 100%;
}
</style>
<style type="text/css">
@media only screen and (max-width:480px) {
table.mj-full-width-mobile {
width: 100% !important;
}

td.mj-full-width-mobile {
width: auto !important;
}
}
</style>
</head>

<body style="word-spacing:normal;background-color:#f7f7f7;">
<div style="background-color:#f7f7f7;">
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
<div style="margin:0px auto;max-width:600px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
<tbody>
<tr>
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
<tbody>
<!-- image-ref: https://github.com/kloudlite/oss/issues/37 -->
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;">
<tbody>
<tr>
<td style="width:120px;">
<img height="auto" src="https://raw.githubusercontent.com/kloudlite/static-assets/master/kloudlite-logo.png" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" width="120" />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<p style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:100%;">
</p>
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px" ><tr><td style="height:0;line-height:0;"> &nbsp;
</td></tr></table><![endif]-->
</td>
</tr>
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;"><strong>{{.Type}}:</strong> {{.Titile}}</div>
</td>
</tr>
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">{{.Body}}</div>
</td>
</tr>
<tr>
<td align="left" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;line-height:100%;">
<tr>
<td align="center" bgcolor="#2563EB" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#2563EB;" valign="middle">
<a href="{{.Link}}" rel="noopener noreferrer" style="display:inline-block;background:#2563EB;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:16px;font-weight:normal;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:3px;" target="_blank"> View Alerts </a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div style="font-family:Open Sans, Arial;font-size:16px;line-height:1.5;text-align:left;color:#555555;">Alternatively, you can copy and paste the following URL into your browser: <a href="{{.Link}}" rel="noopener noreferrer">{{.Link}}</a></div>
</td>
</tr>
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div style="font-family:Open Sans, Arial;font-size:14px;line-height:1;text-align:left;color:#888888;">If you have any questions or need assistance, please don't hesitate to contact us.</div>
</td>
</tr>
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div style="font-family:Open Sans, Arial;font-size:14px;line-height:1;text-align:left;color:#888888;">- Team Kloudlite</div>
</td>
</tr>
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<p style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:100%;">
</p>
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:solid 1px #dddddd;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px" ><tr><td style="height:0;line-height:0;"> &nbsp;
</td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]></td></tr></table><![endif]-->
</div>
</body>

</html>
33 changes: 33 additions & 0 deletions apps/comms/email-templates/alert/email.mjml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- vim: set ft=html: -->
<mjml>
<mj-body background-color="#f7f7f7">
<mj-section padding="20px 0">
<mj-column width="100%">
<!-- image-ref: https://github.com/kloudlite/oss/issues/37 -->
<mj-image align="left" width="120px" src="https://raw.githubusercontent.com/kloudlite/static-assets/master/kloudlite-logo.png"></mj-image>
<mj-divider border-color="#ddd" border-width="1px"></mj-divider>

<mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5">
<strong>{{.Type}}:</strong> {{.Titile}}
</mj-text>
<mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5">
{{.Body}}
</mj-text>
<mj-button align="left" href="{{.Link}}" rel="noopener noreferrer" background-color="#2563EB" font-size="16px" color="#fff">
View Alerts
</mj-button>
<mj-text font-family="Open Sans, Arial" font-size="16px" color="#555" line-height="1.5">
Alternatively, you can copy and paste the following URL into your browser:
<a href="{{.Link}}" rel="noopener noreferrer">{{.Link}}</a>
</mj-text>
<mj-text font-family="Open Sans, Arial" font-size="14px" color="#888">
If you have any questions or need assistance, please don't hesitate to contact us.
</mj-text>
<mj-text font-family="Open Sans, Arial" font-size="14px" color="#888">
- Team Kloudlite
</mj-text>
<mj-divider border-color="#ddd" border-width="1px"></mj-divider>
</mj-column>
</mj-section>
</mj-body>
</mjml>
7 changes: 7 additions & 0 deletions apps/comms/email-templates/alert/email.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{.Type}}: {{.Titile}}

{{.Body}}

If you have any questions or need assistance, please don't hesitate to contact us.

- Team Kloudlite
Loading