]> Raphaël G. Git Repositories - airbundle/commitdiff
Add mail base template
authorRaphaël Gertz <git@rapsys.eu>
Thu, 14 Nov 2019 22:55:33 +0000 (23:55 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 14 Nov 2019 22:58:23 +0000 (23:58 +0100)
Add mail body template
Add mail contact html+text template
Add mail recover html+text template
Add mail recover_mail html+text template
Add mail register html+text template
Remove generic html template

Resources/views/mail/base.html.twig [new file with mode: 0644]
Resources/views/mail/body.html.twig [new file with mode: 0644]
Resources/views/mail/contact.html.twig
Resources/views/mail/contact.text.twig [new file with mode: 0644]
Resources/views/mail/generic.html.twig [deleted file]
Resources/views/mail/recover.html.twig [new file with mode: 0644]
Resources/views/mail/recover.text.twig [new file with mode: 0644]
Resources/views/mail/recover_mail.html.twig [new file with mode: 0644]
Resources/views/mail/recover_mail.text.twig [new file with mode: 0644]
Resources/views/mail/register.html.twig
Resources/views/mail/register.text.twig [new file with mode: 0644]

diff --git a/Resources/views/mail/base.html.twig b/Resources/views/mail/base.html.twig
new file mode 100644 (file)
index 0000000..b7be100
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>{% block title %}Welcome!{% endblock %}</title>
+        {% block stylesheets %}{% endblock %}
+    </head>
+    <body>
+        {% block body %}{% endblock %}
+    </body>
+</html>
diff --git a/Resources/views/mail/body.html.twig b/Resources/views/mail/body.html.twig
new file mode 100644 (file)
index 0000000..fd32b8b
--- /dev/null
@@ -0,0 +1,30 @@
+{% extends '@RapsysAir/mail/base.html.twig' %}
+{% block stylesheets %}
+       <meta name="viewport" content="width=device-width" />
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+       <style type="text/css">
+               body {background:white;color:#066}
+               a {text-decoration:none;color:#066}
+               a:hover {text-decoration:underline}
+               table {width: 100%;border-radius: .5rem}
+               table.header {border:.1rem solid #00c3f9;text-align:center}
+               table.content {background:white;border:.1rem solid #00c3f9;margin:.5rem 0}
+               table.footer {border:.1rem solid #00c3f9;text-align:center;font-weight:bold}
+               table.footer summary:after {display:none}
+               table.footer summary::-webkit-details-marker {display:none}
+       </style>
+{% endblock %}
+{% block body %}
+       <table class="header">
+               <tr>
+                       <td><a href="{{ site_url }}"><img src="{{ email.image(site_logo) }}" alt="{{ site_title|trans }}" /></a></td>
+                       <td><h1><a href="{{ site_url }}">{{ site_title|trans }}</a></h1></td>
+               </tr>
+       </table>
+        {% block content %}{% endblock %}
+       <table class="footer">
+               <tr>
+                       <td>{{ copy_long|trans }} - {{ copy_short|trans }}</td>
+               </tr>
+       </table>
+{% endblock %}
index 7fe13ff79a57c68f72d03bfd33960680dadfcfd5..67cd520931dfa18869cf1af38a08625523ac63ac 100644 (file)
@@ -1,43 +1,14 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-       <meta name="viewport" content="width=device-width" />
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-       <title>{{ subject }}</title>
-       <style>
-               body {background:white;color:#066}
-               a {text-decoration:none;color:#066}
-               a:hover {text-decoration:underline}
-               table {width: 100%;border-radius: .5rem}
-               table.head {border:.1rem solid #00c3f9;text-align:center}
-               table.body {background:white;border:.1rem solid #00c3f9;margin:.5rem 0}
-               table.footer {border:.1rem solid #00c3f9;text-align:center;font-weight:bold}
-               table.footer summary:after {display:none}
-               table.footer summary::-webkit-details-marker {display:none}
-       </style>
-</head>
-<body>
-       <table class="head">
-               <tr>
-                       <td><a href="{{ url }}"><img src="data:image/png;base64, {{ logo|file_get_contents|base64_encode }}" alt="{{ title|trans }}" /></a></td>
-                       <td><h1><a href="{{ url }}">{{ title|trans }}</a></h1></td>
-               </tr>
-       </table>
-       <table class="body">
+{% extends '@RapsysAir/mail/body.html.twig' %}
+{% block title %}{{ subject }}{% endblock %}
+{% block content %}
+       <table class="content">
                <tr>
                        <td>&nbsp;</td>
                        <td>
                <tr>
                        <td>&nbsp;</td>
                        <td>
-                               <h2>{% trans %}Hi,{% endtrans %} {{ contact_name }}</h2>
-                               <h3>{% trans %}Subject:{% endtrans %} {{ subject }}</h3>
+                               <h2>{{ 'Subject: %subject%'|trans({'%subject%': subject}) }}</h2>
                                <p>{{ message|nl2br }}</p>
                        </td>
                        <td>&nbsp;</td>
                </tr>
        </table>
                                <p>{{ message|nl2br }}</p>
                        </td>
                        <td>&nbsp;</td>
                </tr>
        </table>
-       <table class="footer">
-               <tr>
-                       <td>{% trans %}Raphaël Gertz all rights reserved{% endtrans %} - {% trans %}Copyright 2018{% endtrans %}.</td>
-               </tr>
-       </table>
-</body>
-</html>
+{% endblock %}
diff --git a/Resources/views/mail/contact.text.twig b/Resources/views/mail/contact.text.twig
new file mode 100644 (file)
index 0000000..dda3abd
--- /dev/null
@@ -0,0 +1,9 @@
+{{ subject }}
+{% for i in range(1, subject|length) %}={% endfor %}
+
+
+{{ message }}
+
+--
+
+{{ copy_long }} - {{ copy_short }}
diff --git a/Resources/views/mail/generic.html.twig b/Resources/views/mail/generic.html.twig
deleted file mode 100644 (file)
index 5e6da39..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-       <meta name="viewport" content="width=device-width" />
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-       <title>{{ title }}</title>
-       <style>
-               body {background:white;color:#066}
-               a {text-decoration:none;color:#066}
-               a:hover {text-decoration:underline}
-               table {width: 100%;border-radius: .5rem}
-               table.head {border:.1rem solid #00c3f9;text-align:center}
-               table.body {background:white;border:.1rem solid #00c3f9;margin:.5rem 0}
-               table.footer {border:.1rem solid #00c3f9;text-align:center;font-weight:bold}
-               table.footer summary:after {display:none}
-               table.footer summary::-webkit-details-marker {display:none}
-       </style>
-</head>
-<body>
-       <table class="head">
-               <tr>
-                       <td><a href="{{ home }}"><img src="data:image/png;base64, {{ logo|file_get_contents|base64_encode }}" alt="{{ title }}" /></a></td>
-                       <td><h1><a href="{{ home }}">{{ title }}</a></h1></td>
-               </tr>
-       </table>
-       <table class="body">
-               <tr>
-                       <td>&nbsp;</td>
-                       <td>
-                               <h2>{{ subtitle }}</h2>
-                               {% if subject %}
-                                       <h3>{% trans %}Subject:{% endtrans %} {{ subject }}</h3>
-                               {% endif %}
-                               {% if raw is defined %}
-                                       <p>{{ raw|raw }}</p>
-                               {% else %}
-                                       <p>{{ message|nl2br }}</p>
-                               {% endif %}
-                       </td>
-                       <td>&nbsp;</td>
-               </tr>
-       </table>
-       <table class="footer">
-               <tr>
-                       <td>{% trans %}Raphaël Gertz all rights reserved{% endtrans %} - {% trans %}Copyright 2018{% endtrans %}.</td>
-               </tr>
-       </table>
-</body>
-</html>
diff --git a/Resources/views/mail/recover.html.twig b/Resources/views/mail/recover.html.twig
new file mode 100644 (file)
index 0000000..d7ed809
--- /dev/null
@@ -0,0 +1,16 @@
+{% extends '@RapsysAir/mail/body.html.twig' %}
+{% block title %}{{ subject }}{% endblock %}
+{% block content %}
+       <table class="content">
+               <tr>
+                       <td>&nbsp;</td>
+                       <td>
+                               <h2>{{ 'Subject: %subject%'|trans({'%subject%': 'welcome back to %site_title%'|trans({'%site_title%': site_title|trans})}) }}</h2>
+                               <p>{{ 'Thanks so much for rejoining %site_title%, the space reservation program.'|trans({'%site_title%': site_title|trans}) }}</p>
+                               <p>{% trans %}To recover your account you can follow this link: {% endtrans %}</p>
+                               <p><a href="{{ recover_url }}">{{ recover_url }}</a></p>
+                       </td>
+                       <td>&nbsp;</td>
+               </tr>
+       </table>
+{% endblock %}
diff --git a/Resources/views/mail/recover.text.twig b/Resources/views/mail/recover.text.twig
new file mode 100644 (file)
index 0000000..794d375
--- /dev/null
@@ -0,0 +1,11 @@
+{{ subject }}
+{% for i in range(1, subject|length) %}={% endfor %}
+
+
+*{{ 'Thanks so much for rejoining %site_title%, the space reservation program.'|trans({'%site_title%': site_title|trans}) }}*
+
+{{ 'To recover your account you can follow this link: %recover_url%'|trans({'%recover_url%': recover_url}) }}
+
+--
+
+{{ copy_long }} - {{ copy_short }}
diff --git a/Resources/views/mail/recover_mail.html.twig b/Resources/views/mail/recover_mail.html.twig
new file mode 100644 (file)
index 0000000..0cfc299
--- /dev/null
@@ -0,0 +1,16 @@
+{% extends '@RapsysAir/mail/body.html.twig' %}
+{% block title %}{{ subject }}{% endblock %}
+{% block content %}
+       <table class="content">
+               <tr>
+                       <td>&nbsp;</td>
+                       <td>
+                               <h2>{{ 'Subject: %subject%'|trans({'%subject%': 'welcome back to %site_title%'|trans({'%site_title%': site_title|trans})}) }}</h2>
+                               <p>{{ 'Thanks so much for rejoining %site_title%, the space reservation program.'|trans({'%site_title%': site_title|trans}) }}</p>
+                               <p>{% trans %}Your account password has been changed, to recover your account you can follow this link: {% endtrans %}</p>
+                               <p><a href="{{ recover_url }}">{{ recover_url }}</a></p>
+                       </td>
+                       <td>&nbsp;</td>
+               </tr>
+       </table>
+{% endblock %}
diff --git a/Resources/views/mail/recover_mail.text.twig b/Resources/views/mail/recover_mail.text.twig
new file mode 100644 (file)
index 0000000..5a44050
--- /dev/null
@@ -0,0 +1,11 @@
+{{ subject }}
+{% for i in range(1, subject|length) %}={% endfor %}
+
+
+*{{ 'Thanks so much for rejoining %site_title%, the space reservation program.'|trans({'%site_title%': site_title|trans}) }}*
+
+{{ 'Your account password has been changed, to recover your account you can follow this link: %recover_url%'|trans({'%recover_url%': recover_url}) }}
+
+--
+
+{{ copy_long }} - {{ copy_short }}
index 8a6c0d3dac54370f123db7d332c16cd531ac140c..b5228d23ad6a631d54e1e2ed7e106ddb1206d05a 100644 (file)
@@ -1,43 +1,15 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-       <meta name="viewport" content="width=device-width" />
-       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-       <title>{{ 'Welcome to %title%'|trans({'%title%': title}) }}</title>
-       <style>
-               body {background:white;color:#066}
-               a {text-decoration:none;color:#066}
-               a:hover {text-decoration:underline}
-               table {width: 100%;border-radius: .5rem}
-               table.head {border:.1rem solid #00c3f9;text-align:center}
-               table.body {background:white;border:.1rem solid #00c3f9;margin:.5rem 0}
-               table.footer {border:.1rem solid #00c3f9;text-align:center;font-weight:bold}
-               table.footer summary:after {display:none}
-               table.footer summary::-webkit-details-marker {display:none}
-       </style>
-</head>
-<body>
-       <table class="head">
-               <tr>
-                       <td><a href="{{ url }}"><img src="data:image/png;base64, {{ logo|file_get_contents|base64_encode }}" alt="{{ title|trans }}" /></a></td>
-                       <td><h1><a href="{{ url }}">{{ title|trans }}</a></h1></td>
-               </tr>
-       </table>
-       <table class="body">
+{% extends '@RapsysAir/mail/body.html.twig' %}
+{% block title %}{{ subject }}{% endblock %}
+{% block content %}
+       <table class="content">
                <tr>
                        <td>&nbsp;</td>
                        <td>
                <tr>
                        <td>&nbsp;</td>
                        <td>
-                               <h2>{% trans %}Hi,{% endtrans %} {{ contact_name }}</h2>
-                               <h3>{% trans %}Subject:{% endtrans %} {{ 'Welcome to %title%'|trans({'%title%': title|trans}) }}</h3>
-                               <p>{{ 'Thanks so much for joining us, from now you can reserver your %title% spaces.'|trans({'%title%': title|trans}) }}</p>
+                               <h2>{{ 'Subject: %subject%'|trans({'%subject%': 'welcome to %site_title%'|trans({'%site_title%': site_title|trans})}) }}</h2>
+                               <h3>{{ 'Hi %recipient_name%,'|trans({'%recipient_name%': recipient_name}) }}</h3>
+                               <p>{{ 'Thanks so much for joining %site_title%, the space reservation program.'|trans({'%site_title%': site_title|trans}) }}</p>
                        </td>
                        <td>&nbsp;</td>
                </tr>
        </table>
                        </td>
                        <td>&nbsp;</td>
                </tr>
        </table>
-       <table class="footer">
-               <tr>
-                       <td>{% trans %}Raphaël Gertz all rights reserved{% endtrans %} - {% trans %}Copyright 2018{% endtrans %}.</td>
-               </tr>
-       </table>
-</body>
-</html>
+{% endblock %}
diff --git a/Resources/views/mail/register.text.twig b/Resources/views/mail/register.text.twig
new file mode 100644 (file)
index 0000000..b91e442
--- /dev/null
@@ -0,0 +1,9 @@
+{{ subject }}
+{% for i in range(1, subject|length) %}={% endfor %}
+
+
+*{{ 'Thanks so much for joining %site_title%, the space reservation program.'|trans({'%site_title%': site_title|trans}) }}*
+
+--
+
+{{ copy_long }} - {{ copy_short }}