Skip to content

Commit

Permalink
Merge pull request #238 from alkem-io/develop
Browse files Browse the repository at this point in the history
Release: Templates
  • Loading branch information
valentinyanakiev authored Aug 3, 2023
2 parents 4e97587 + 46fc04b commit 525e72f
Show file tree
Hide file tree
Showing 41 changed files with 309 additions and 303 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build-deploy-k8s-sandbox-azure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build & Deploy to Sandbox on Azure

on:
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# checkout the repo
- name: "Checkout github Action"
uses: actions/checkout@master

- name: "Login via Azure CLI"
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CRED_K8S_NEW }}

- name: "Build and push image"
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-notifications:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-notifications:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-notifications:${{ github.sha }}
- uses: Azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CRED_K8S_NEW }}
cluster-name: k8s-sandbox
resource-group: res-grp-k8s-sandbox

- uses: Azure/k8s-create-secret@v1
with:
container-registry-url: ${{ secrets.REGISTRY_LOGIN_SERVER }}
container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
secret-name: alkemio-notifications-secret

- uses: Azure/k8s-deploy@v1
with:
manifests: |
service/manifests/25-notifications-deployment-dev.yaml
images: |
${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-notifications:${{ github.sha }}
imagepullsecrets: |
alkemio-notifications-secret
18 changes: 9 additions & 9 deletions service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alkemio-notifications",
"version": "0.13.0",
"version": "0.14.0",
"description": "Alkemio notifications service",
"author": "Alkemio Foundation",
"private": false,
Expand Down Expand Up @@ -35,7 +35,7 @@
"validate-connection": "ts-node src/utils/validate-connection.ts"
},
"dependencies": {
"@alkemio/client-lib": "^0.21.0",
"@alkemio/client-lib": "^0.23.0",
"@alkemio/notifications-lib": "^0.6.0",
"@nestjs/common": "^8.0.5",
"@nestjs/config": "^1.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface CollaborationCalloutPublishedEmailPayload
callout: {
displayName: string;
url: string;
type: string;
};
publishedBy: {
firstName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class CollaborationCalloutPublishedNotificationBuilder
callout: {
displayName: eventPayload.callout.displayName,
url: calloutURL,
type: eventPayload.callout.type,
},
journey: {
displayName: eventPayload.journey.displayName,
Expand Down
119 changes: 60 additions & 59 deletions service/src/templates/_layouts/email-transactional.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
table,
td {
border-collapse: collapse;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
border: 0;
Expand All @@ -53,12 +51,25 @@
.content {
cursor: auto;
color: #000;
font-family: Source Sans Pro;
font-family: inherit;
font-size: 17px;
line-height: 22px;
text-align: left;
text-align: center;
white-space: pre-line;
}
.action-button {
background-color: #065f6b;
border: none;
border-radius: 12px;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
margin: 4px 2px;
cursor: pointer;
}
</style>
<!--[if !mso]><!-->

Expand Down Expand Up @@ -215,6 +226,17 @@
[endif]-->
</td>
</tr>
<tr>
<td style="text-align: center">
<a href="https://alkem.io"
><img
src="https://alkemio.org/uploads/logos/alkemio-logo.png"
width="120"
alt="alkemio-logo"
/></a>
<br />
</td>
</tr>
<tr>
<td
style="
Expand All @@ -223,7 +245,9 @@
padding: 10px;
"
>
<div class="content">{% block content %}{% endblock %}</div>
<div class="content">
{% block content %}{% endblock %}
</div>
</td>
</tr>
<tr>
Expand All @@ -238,69 +262,31 @@
</td>
</tr>
<tr>
<td style="padding: 0 10px; color: black">
<b>Team Alkemio</b><br />
<br />
<a href="https://alkem.io"
><img
src="https://alkemio.org/uploads/logos/alkemio-logo.png"
width="175"
alt="alkemio-logo"
/></a>
<br />Website:
<a
<td>
<hr
style="
color: #068293;
text-decoration: underline;
display: inline-block;
padding-top: 5px;
border-color: lightgray;
width: 50%;
margin: 15px auto;
"
href="https://alkem.io"
>https://alkem.io</a
>
</td>
</tr>
<tr>
<td style="padding-top: 20px">
<a href="https://alkem.io"
><img
src="https://alkemio.org/uploads/vizualization-email-footer.jpg"
width="100%"
alt="alkemio-logo"
/></a>
</td>
</tr>
<tr>
<td
style="display:table-cell; text-align: center; width:100% height: 100%; padding: 10px 0; font-size: 14px;"
>
{% block footer %}{% endblock %}
</td>
</tr>
<tr>
<td style="padding-top: 3px">
<svg width="max" height="15">
<rect
width="100%"
height="3"
style="fill: rgb(0, 129, 143)"
></rect>
</svg>
/>
</td>
</tr>
<tr>
<td
style="
color: darkgrey;
color: #666666;
font-size: 12px;
text-align: center;
padding: 0 10px;
line-height: 1.6;
"
>
Don't want to recieve these notifications? Change your
settings on the notifications settings to no longer
recieve them anymore.
Empowering society. Alkemio offers you the platform to
succeed in working on challenges, together.<br />
PURPOSE DRIVEN &nbsp;&nbsp;|&nbsp;&nbsp; OPEN SOURCE
&nbsp;&nbsp;|&nbsp;&nbsp; INNOVATION
<br />
</td>
</tr>
<tr width="100%">
Expand All @@ -313,8 +299,8 @@
style="
display: inline-block;
padding: 10px 5px;
width: 35px;
height: 35px;
width: 15px;
height: 15px;
display: inline-block;
"
src="https://i.ibb.co/vcm298P/2048px-Octicons-mark-github-svg.png"
Expand All @@ -328,15 +314,30 @@
style="
display: inline-block;
padding: 10px 5px;
width: 35px;
height: 35px;
width: 15px;
height: 15px;
"
src="https://i.ibb.co/RBYFC4Z/174857.png"
alt="174857"
/> </a
><br />
</td>
</tr>
<tr>
<td
style="
display: table-cell;
text-align: center;
width: 100%;
height: 100%;
padding: 10px 0;
color: #a9a9a9;
font-size: 10px;
"
>
{% block footer %}{% endblock %}
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
38 changes: 7 additions & 31 deletions service/src/templates/alkemio.template.blocks.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,16 @@
module.exports = {
footerBlock: `{% block footer %}<a
stylstylee="
color: #068293;
text-decoration: underline;
font-family: Montserrat;
padding: 15px 5px;
"
href="{{space.url}}"
alt="Link to our community"
>Join our community</a
>
&nbsp;
footerBlock: `{% block footer %}
{% if recipient.notificationPreferences !== '' %}
<a
<span style="padding: 15px 0; color: #a9a9a9;">
Would you like to change your notification preferences? Change the settings <a
style="
color: #068293;
color: #a9a9a9;
text-decoration: underline;
font-family: Montserrat;
padding: 15px 5px;
"
href="{{recipient.notificationPreferences}}"
alt="User notification preferences"
>Notification settings</a
>
&nbsp;
alt="Notification settings"
>here</a>.
</span>
{% endif %}
<a
style="
color: #068293;
text-decoration: underline;
font-family: Montserrat;
padding: 15px 5px;
"
href="https://alkemio.foundation/"
alt="About Alkemio"
>About</a
>
{% endblock %}`,
};
14 changes: 6 additions & 8 deletions service/src/templates/collaboration.callout.published.member.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@ var templates = require('./alkemio.template.blocks');
/* eslint-disable quotes */
module.exports = () => ({
name: 'collaboration-callout-published-member',
title:
'{{journey.displayName}} - New callout is published: "{{callout.displayName}}", have a look!',
version: 1,
channels: {
email: {
from: '{{emailFrom}}',
to: '{{recipient.email}}',
subject:
'{{journey.displayName}} - New callout is published "{{callout.displayName}}", have a look!',
'{{journey.displayName}} - New {{callout.type}} is published "{{callout.displayName}}", have a look!',
html: `{% extends "src/templates/_layouts/email-transactional.html" %}
{% block content %}Hi {{recipient.firstName}},
A new callout was published by {{publishedBy.firstName}} with name: '<a href={{callout.url}}>{{callout.displayName}}</a>'.
Sincerely yours,
{% block content %}
Hi {{recipient.firstName}}, <br><br>
<b>{{publishedBy.firstName}}</b> published a new {{callout.type}} in {{journey.type}}: "{{journey.displayName}}", with name: "<a style="color:#065F6B; text-decoration: none;" href={{callout.url}}>{{callout.displayName}}</a>".
<br><br>
<a class="action-button" href="{{callout.url}}">HAVE A LOOK!</a>
{% endblock %}
${templates.footerBlock}`,
},
Expand Down
Loading

0 comments on commit 525e72f

Please sign in to comment.