-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add responsive email format to the babylon-notifier #662
Open
makirill
wants to merge
6
commits into
redhat-cop:main
Choose a base branch
from
makirill:feature/mjml-notification-formatter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0a374dc
Adding MJML CLI to the babylon-notifier image
makirill 9518e3c
Adding MJML templates
makirill 2cae08a
Freeze versions for npm and mjml
makirill 75d1a3b
Updating templates
makirill 72c362b
Updating odo devfile to use assemble script
makirill 164ccd9
Moving mj-column and mj-text from parent template to child
makirill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
npm install -g npm@8.19.3 | ||
npm install -g mjml@4.13.0 | ||
|
||
exec /usr/libexec/s2i/assemble |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<mjml> | ||
<mj-body> | ||
<!-- Company Header --> | ||
<mj-section full-width="full-width" background-color="#151515" padding-top="8px" padding-bottom="8px" padding-left="12px" padding-right="12px"> | ||
<mj-group> | ||
<mj-column vertical-align="middle"> | ||
<mj-image href="https://demo.redhat.com/" title="RedHat" alt="RedHat" width="185px" src="https://public-assets-email.s3.us-east-2.amazonaws.com/Logo-Red_Hat-A-Reverse-RGB.png" /> | ||
</mj-column> | ||
</mj-group> | ||
</mj-section> | ||
<!-- spacer --> | ||
<mj-section padding-top="0" padding-bottom="0" padding-left="0" padding-right="0"> | ||
<mj-column> | ||
<mj-spacer height="25px" /> | ||
</mj-column> | ||
</mj-section> | ||
<!-- Title --> | ||
<mj-section padding-top="21px" padding-bottom="12px" padding-left="12px" padding-right="12px"> | ||
<mj-column> | ||
<mj-text font-family="Red Hat Text" font-weight="regular" align="center" font-size="16px" color="#000" line-height="1.2"> | ||
Status: {{ service_status }} | ||
</mj-text> | ||
<mj-text font-family="Red Hat Display" font-weight="regular" align="center" font-size="35px" color="#000" line-height="1.2"> | ||
{{ service_display_name }} | ||
</mj-text> | ||
<mj-text font-family="Red Hat Text" font-weight="regular" align="center" font-size="16px" color="#000" line-height="1.2"> | ||
from {{ catalog_namespace.display_name }} | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
|
||
<!-- spacer --> | ||
<mj-section padding-top="0" padding-bottom="0" padding-left="0" padding-right="0"> | ||
<mj-column> | ||
<mj-spacer height="25px" /> | ||
</mj-column> | ||
</mj-section> | ||
<!-- Text --> | ||
<mj-section padding-top="12px" padding-bottom="12px" padding-left="12px" padding-right="12px" background-color="#f0f0f0"> | ||
<mj-column> | ||
<mj-text font-family="Red Hat Text" color="#4a5557" font-size="16px" line-height="1.5" padding-bottom="12px"> | ||
{% block content %}{% endblock %} | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
|
||
<!-- Footer --> | ||
<mj-section padding-top="12px" padding-bottom="12px" padding-left="12px" padding-right="12px"> | ||
<mj-column> | ||
<mj-text align="center" font-size="12px" color="#4a5557" font-family="Red Hat Text" line-height="1.5"> | ||
<b>RedHat | ||
</b> © Copyright 2022 - All rights reserved | ||
</mj-text> | ||
</mj-column> | ||
</mj-section> | ||
<!-- Footer --> | ||
</mj-body> | ||
</mjml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...or/templates/retirement-scheduled.html.j2 → ...or/templates/retirement-scheduled.mjml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
{% extends "base.mjml.j2" %} | ||
{% block content %} | ||
|
||
<p>Reminder:<br> | ||
Your environment will expire and be deleted in {{ retirement_timedelta_humanized }} at {{ retirement_timestamp }}.</p> | ||
|
||
{% if service_url %} | ||
<p>You may manage your {{ catalog_namespace.display_name }} service at:<br> | ||
<a href="{{ service_url }}">{{ service_url }}</a>.</p> | ||
{% endif %} | ||
|
||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
.../operator/templates/stop-complete.html.j2 → .../operator/templates/stop-complete.mjml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
{% extends "base.mjml.j2" %} | ||
{% block content %} | ||
|
||
<p>Your {{ catalog_namespace.display_name }} service {{ service_display_name }} has stopped.</p> | ||
|
||
{% if service_url %} | ||
<p>You may manage your {{ catalog_namespace.display_name }} service at:<br> | ||
<a href="{{ service_url }}">{{ service_url }}</a>.</p> | ||
{% endif %} | ||
|
||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...operator/templates/stop-scheduled.html.j2 → ...operator/templates/stop-scheduled.mjml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
{% extends "base.mjml.j2" %} | ||
{% block content %} | ||
|
||
<p>Reminder:<br> | ||
Your environment will be stopped in {{ stop_timedelta_humanized }} at {{ stop_timestamp }}.</p> | ||
|
||
{% if service_url %} | ||
<p>You may manage your {{ catalog_namespace.display_name }} service at:<br> | ||
<a href="{{ service_url }}">{{ service_url }}</a>.</p> | ||
{% endif %} | ||
|
||
{% endblock content %} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Lift the content to be inside the mj-section
And then in every .mjml template use the mj-column / mj-text accordingly. As it is now the templates will not have lots of flexibility as they are encapsulated under those elements and they use plain html syntax without having the benefits of mjml syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. I wanted to implement it this way initially but for some reason I've change my mind and left
child
templates with pure HTML/JINJA2 without any MJML tags.New commit should fix it - 164ccd9