refactor: twig templating

This commit is contained in:
Maël Gangloff 2024-08-21 19:03:31 +02:00
parent 220160241a
commit 5ddd42eded
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629
7 changed files with 141 additions and 357 deletions

View File

@ -25,8 +25,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="manifest" href="/manifest.json"/>
<title>Domain Watchdog</title> <title>Domain Watchdog</title>
<link rel="manifest" href="/manifest.json"/>
<link rel="icon" type="image/x-icon" href="/favicon.ico">
{{ encore_entry_link_tags('app') }} {{ encore_entry_link_tags('app') }}
</head> </head>
<body> <body>

View File

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #f9f9f9;
}
.header {
text-align: center;
margin-bottom: 20px;
}
.header h1 {
font-size: 24px;
color: {{ email_color|default('#0056b3') }};
}
.content {
margin-bottom: 20px;
}
.content p {
margin: 0 0 10px;
}
.footer {
text-align: center;
color: #777;
}
</style>
<title>{{ title|default('Domain Watchdog - Notification') }}</title>
</head>
<body>
<div class="container">
<div class="header">
<h1>{{ title|default('Domain Watchdog - Notification') }}</h1>
</div>
<div class="content">
{% block content %}{% endblock %}
</div>
<div class="footer">
{% block footer %}
<p>&copy; Domain Watchdog</p>
{% endblock %}
</div>
</div>
</body>
</html>

View File

@ -1,80 +1,20 @@
<!DOCTYPE html> {% extends "emails/base.html.twig" %}
<html lang="en">
<head>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
}
.container { {% set email_color = '#f9f9f9' %}
max-width: 600px; {% set title = 'Domain Watchdog Error' %}
margin: 0 auto; {% block content %}
padding: 20px; <p>Hello, <br/>
border: 1px solid #ddd; We would like to inform you that an error occurred while ordering the following domain name:<br/>
border-radius: 5px; <strong>Domain name:</strong> {{ domain.ldhName }}<br/>
background-color: #f9f9f9; </p>
} <p>Here are some possible explanations:</p>
<ul>
.header { <li>The Connector configuration you provided is no longer valid.</li>
text-align: center; <li>It is likely that the domain is no longer available for registration.</li>
margin-bottom: 20px; <li>A temporary interruption is affecting the registration of this domain name.</li>
} </ul>
<br/><br/>
.header h1 { <p>Thank you for your understanding,<br/>
font-size: 24px; Sincerely,<br/>
color: #d9534f; </p>
} {% endblock %}
.content {
margin-bottom: 20px;
}
.content p {
margin: 0 0 10px;
}
.footer {
text-align: center;
color: #777;
}
ul {
padding-left: 20px;
}
ul li {
margin-bottom: 10px;
}
</style>
<title>Domain Watchdog Error</title>
</head>
<body>
<div class="container">
<div class="header">
<h1>Domain Watchdog Error</h1>
</div>
<div class="content">
<p>Hello, <br/>
We would like to inform you that an error occurred while ordering the following domain name:<br/>
<strong>Domain name:</strong> {{ domain.ldhName }}<br/>
</p>
<p>Here are some possible explanations:</p>
<ul>
<li>The Connector configuration you provided is no longer valid.</li>
<li>It is likely that the domain is no longer available for registration.</li>
<li>A temporary interruption is affecting the registration of this domain name.</li>
</ul>
<br/><br/>
<p>Thank you for your understanding,<br/>
Sincerely,<br/>
Domain Watchdog<br/>
</p>
</div>
<div class="footer">
<p>&copy; Domain Watchdog</p>
</div>
</div>
</body>
</html>

View File

@ -1,81 +1,20 @@
<!DOCTYPE html> {% extends "emails/base.html.twig" %}
<html lang="en">
<head>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
}
.container { {% set email_color = '#f9f9f9' %}
max-width: 600px; {% set title = 'Domain Watchdog Error' %}
margin: 0 auto; {% block content %}
padding: 20px; <p>Hello, <br/>
border: 1px solid #ddd; We would like to inform you that an error occurred while updating the information for the following domain
border-radius: 5px; name:<br/>
background-color: #f9f9f9; <strong>Domain name:</strong> {{ domain.ldhName }}<br/>
} </p>
<p>Here are some possible explanations:</p>
.header { <ul>
text-align: center; <li>It is likely that the domain will be available for registration again.</li>
margin-bottom: 20px; <li>A temporary outage affects the provision of domain name information.</li>
} </ul>
<br/><br/>
.header h1 { <p>Thank you for your understanding,<br/>
font-size: 24px; Sincerely,<br/>
color: #d9534f; </p>
} {% endblock %}
.content {
margin-bottom: 20px;
}
.content p {
margin: 0 0 10px;
}
.footer {
text-align: center;
color: #777;
}
ul {
padding-left: 20px;
}
ul li {
margin-bottom: 10px;
}
</style>
<title>Domain Watchdog Error</title>
</head>
<body>
<div class="container">
<div class="header">
<h1>Domain Watchdog Error</h1>
</div>
<div class="content">
<p>Hello, <br/>
We would like to inform you that an error occurred while updating the information for the following domain
name:<br/>
<strong>Domain name:</strong> {{ domain.ldhName }}<br/>
</p>
<p>Here are some possible explanations:</p>
<ul>
<li>It is likely that the domain will be available for registration again.</li>
<li>A temporary outage affects the provision of domain name information.</li>
</ul>
<br/><br/>
<p>Thank you for your understanding,<br/>
Sincerely,<br/>
Domain Watchdog<br/>
</p>
</div>
<div class="footer">
<p>&copy; Domain Watchdog</p>
</div>
</div>
</body>
</html>

View File

@ -1,66 +1,14 @@
<!DOCTYPE html> {% extends "emails/base.html.twig" %}
<html lang="en">
<head>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
}
.container { {% set email_color = '#0056b3' %}
max-width: 600px; {% set title = 'Domain Watchdog - Confirm Email' %}
margin: 0 auto; {% block content %}
padding: 20px; <p>Hello, <br/>
border: 1px solid #ddd; Please confirm your email address by clicking the following link: <br><br>
border-radius: 5px; <a href="{{ signedUrl|raw }}">Confirm my Email</a>.
background-color: #f9f9f9; This link will expire in {{ expiresAtMessageKey|trans(expiresAtMessageData, 'VerifyEmailBundle') }}.
} <br/><br/>
Thank you for your understanding,<br/>
.header { Sincerely,<br/>
text-align: center; </p>
margin-bottom: 20px; {% endblock %}
}
.header h1 {
font-size: 24px;
color: #0056b3;
}
.content {
margin-bottom: 20px;
}
.content p {
margin: 0 0 10px;
}
.footer {
text-align: center;
color: #777;
}
</style>
<title>Domain Watchdog - Confirm Email</title>
</head>
<body>
<div class="container">
<div class="header">
<h1>Domain Watchdog - Confirm Email</h1>
</div>
<div class="content">
<p>Hello, <br/>
Please confirm your email address by clicking the following link: <br><br>
<a href="{{ signedUrl|raw }}">Confirm my Email</a>.
This link will expire in {{ expiresAtMessageKey|trans(expiresAtMessageData, 'VerifyEmailBundle') }}.
<br/><br/>
Thank you for your understanding,<br/>
Sincerely,<br/>
Domain Watchdog<br/>
</p>
</div>
<div class="footer">
<p>&copy; Domain Watchdog</p>
</div>
</div>
</body>
</html>

View File

@ -1,67 +1,15 @@
<!DOCTYPE html> {% extends "emails/base.html.twig" %}
<html lang="en">
<head>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
}
.container { {% set email_color = '#0056b3' %}
max-width: 600px; {% set title = 'Domain Watchdog - Domain Ordered' %}
margin: 0 auto; {% block content %}
padding: 20px; <p>Hello, <br/>
border: 1px solid #ddd; We are pleased to inform you that a domain name present in your Watchlist has been ordered using the
border-radius: 5px; connector you have chosen.<br/>
background-color: #f9f9f9; <strong>Domain name:</strong> {{ domain.ldhName }}<br/>
} <strong>Connector provider :</strong> {{ provider }}<br/>
<br/><br/>
.header { Thank you for your understanding,<br/>
text-align: center; Sincerely,<br/>
margin-bottom: 20px; </p>
} {% endblock %}
.header h1 {
font-size: 24px;
color: #0056b3;
}
.content {
margin-bottom: 20px;
}
.content p {
margin: 0 0 10px;
}
.footer {
text-align: center;
color: #777;
}
</style>
<title>Domain Watchdog - Domain Ordered</title>
</head>
<body>
<div class="container">
<div class="header">
<h1>Domain Watchdog - Domain Ordered</h1>
</div>
<div class="content">
<p>Hello, <br/>
We are pleased to inform you that a domain name present in your Watchlist has been ordered using the
connector you have chosen.<br/>
<strong>Domain name:</strong> {{ domain.ldhName }}<br/>
<strong>Connector provider :</strong> {{ provider }}<br/>
<br/><br/>
Thank you for your understanding,<br/>
Sincerely,<br/>
Domain Watchdog<br/>
</p>
</div>
<div class="footer">
<p>&copy; Domain Watchdog</p>
</div>
</div>
</body>
</html>

View File

@ -1,67 +1,15 @@
<!DOCTYPE html> {% extends "emails/base.html.twig" %}
<html lang="en">
<head>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
}
.container { {% set email_color = '#0056b3' %}
max-width: 600px; {% set title = 'Domain Watchdog Alert' %}
margin: 0 auto; {% block content %}
padding: 20px; <p>Hello, <br/>
border: 1px solid #ddd; We are pleased to inform you that a new action has been detected on a domain name in your watchlist.<br/>
border-radius: 5px; <strong>Domain name:</strong> {{ event.domain.ldhName }}<br/>
background-color: #f9f9f9; <strong>Action:</strong> {{ event.action }}<br/>
} <strong>Effective Date:</strong> {{ event.date | date("c") }}<br/>
<br/><br/>
.header { Thank you for your understanding,<br/>
text-align: center; Sincerely,<br/>
margin-bottom: 20px; </p>
} {% endblock %}
.header h1 {
font-size: 24px;
color: #0056b3;
}
.content {
margin-bottom: 20px;
}
.content p {
margin: 0 0 10px;
}
.footer {
text-align: center;
color: #777;
}
</style>
<title>Domain Watchdog Alert</title>
</head>
<body>
<div class="container">
<div class="header">
<h1>Domain Watchdog Alert</h1>
</div>
<div class="content">
<p>Hello, <br/>
We are pleased to inform you that a new action has been detected on a domain name in your watchlist.<br/>
<strong>Domain name:</strong> {{ event.domain.ldhName }}<br/>
<strong>Action:</strong> {{ event.action }}<br/>
<strong>Effective Date:</strong> {{ event.date | date("c") }}<br/>
<br/><br/>
Thank you for your understanding,<br/>
Sincerely,<br/>
Domain Watchdog<br/>
</p>
</div>
<div class="footer">
<p>&copy; Domain Watchdog</p>
</div>
</div>
</body>
</html>