More meaningful mail views

This commit is contained in:
Samuel Georges 2017-07-22 17:19:47 +10:00
parent 8e0279e45e
commit 181be5979a
8 changed files with 73 additions and 28 deletions

View File

@ -292,13 +292,13 @@ class ServiceProvider extends ModuleServiceProvider
*/
MailManager::instance()->registerCallback(function ($manager) {
$manager->registerMailLayouts([
'default' => 'system::mail.default',
'system' => 'system::mail.system',
'default' => 'system::mail.layout-default',
'system' => 'system::mail.layout-system',
]);
$manager->registerMailPartials([
'button' => 'system::mail.button',
'table' => 'system::mail.table',
'button' => 'system::mail.partial-button',
'table' => 'system::mail.partial-table',
]);
});

View File

@ -1,5 +0,0 @@
name = "Button"
==
{{ body|raw }}
==
<button>{{ body|raw }}</button>

View File

@ -1,14 +0,0 @@
name = "Default layout"
==
{{ content|raw }}
==
<html>
<head>
<style type="text/css" media="screen">
{{ css|raw }}
</style>
</head>
<body>
{{ content|raw }}
</body>
</html>

View File

@ -0,0 +1,40 @@
name = "Default layout"
==
{{ content|raw }}
==
<!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, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<style type="text/css" media="screen">
{{ brandCss|raw }}
{{ css|raw }}
</style>
<table class="wrapper" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<table class="content" width="100%" cellpadding="0" cellspacing="0">
<!-- Email Body -->
<tr>
<td class="body" width="100%" cellpadding="0" cellspacing="0">
<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0">
<!-- Body content -->
<tr>
<td class="content-cell">
{{ content|raw }}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

View File

@ -9,6 +9,7 @@ This is an automatic message. Please do not reply to it.
<html>
<head>
<style type="text/css" media="screen">
{{ brandCss|raw }}
{{ css|raw }}
</style>
</head>

View File

@ -0,0 +1,23 @@
name = "Button"
==
{{ body }} <{{ url }}>
==
<table class="action" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="{{ url }}" class="button button-{{ type ?: 'primary' }}" target="_blank">{{ body }}</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

View File

@ -0,0 +1,5 @@
name = "Table"
==
{{ body }}
==
<div class="table">{{ body|md }}</div>

View File

@ -1,5 +0,0 @@
name = "Table"
==
{{ body|raw }}
==
<div class="table">{{ body|raw }}</div>