Skip to content

Commit

Permalink
Merge pull request #60 from laravel-enso/new_email_notifications_temp…
Browse files Browse the repository at this point in the history
…late

New email notifications template
  • Loading branch information
gandesc authored May 7, 2018
2 parents 950a606 + 5ad7a5d commit 1f94fbf
Show file tree
Hide file tree
Showing 13 changed files with 504 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ private function publishesResources()
$this->publishes([
__DIR__.'/resources/views' => resource_path('views/vendor/laravel-enso'),
]);

$this->publishes([
__DIR__.'/resources/views/emails' => resource_path('views/emails'),
__DIR__.'/resources/assets/images' => resource_path('assets/images'),
], 'email-templates');

$this->publishes([
__DIR__.'/resources/views/emails' => resource_path('views/emails'),
__DIR__.'/resources/assets/images' => resource_path('assets/images'),
], 'core-email-templates');
}

private function registerMiddleware()
Expand Down
13 changes: 10 additions & 3 deletions src/app/Notifications/ResetPasswordNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace LaravelEnso\Core\app\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Support\Facades\App;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
Expand All @@ -27,11 +28,17 @@ public function via($notifiable)

public function toMail($notifiable)
{
app()->setLocale($notifiable->preferences->global->lang);

return (new MailMessage())
->subject(__('Reset Password Notification'))
->line(__('Please set or reset your password by clicking the button below.'))
->action(__('Direct Link'), config('app.url').'/password/reset/'.$this->token)
->line(__('Thank you for using our application!'));
->view('emails.passwordReset',
[
'body' => __('Please set or reset your password by clicking the button below.'),
'ending' => __('Thank you for using our application!'),
'resetURL' => config('app.url').'/password/reset/'.$this->token,
'buttonLabel' => __('Reset Your Password'),
]);
}

public function toArray($notifiable)
Expand Down
155 changes: 155 additions & 0 deletions src/resources/assets/css/emails.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,900);

/* Take care of image borders and formatting */

img {
max-width: 600px;
outline: none;
text-decoration: none;
-ms-interpolation-mode: bicubic;
}

a img {
border: none;
}

table {
border-collapse: collapse !important;
}

#outlook a {
padding: 0;
}

.ReadMsgBody {
width: 100%;
}

.ExternalClass {
width: 100%;
}

.backgroundTable {
margin: 0 auto;
padding: 0;
width: 100% !important;
}

table td {
border-collapse: collapse;
}

.ExternalClass * {
line-height: 115%;
}

/* General styling */

td {
font-family: Arial, sans-serif;
}

body {
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: none;
width: 100%;
height: 100%;
color: #6f6f6f;
font-weight: 400;
font-size: 18px;
}

h1 {
margin: 10px 0;
}

a {
color: #27aa90;
text-decoration: none;
}

.force-full-width {
width: 100% !important;
}

.body-padding {
padding: 0 75px;
}

.force-width-80 {
width: 80% !important;
}

.spaced-out-lines {
line-height: 1.4;
}

@media screen {
/* Thanks Outlook 2013! */
* {
font-family: 'Source Sans Pro', 'Helvetica Neue', 'Arial', 'sans-serif' !important;
}
.w280 {
width: 280px !important;
}

}

/* Mobile styles */
@media only screen and (max-width: 480px) {

table[class*="w320"] {
width: 320px !important;
}

td[class*="w320"] {
width: 280px !important;
padding-left: 20px !important;
padding-right: 20px !important;
}

img[class*="w320"] {
width: 250px !important;
height: 67px !important;
}

td[class*="mobile-spacing"] {
padding-top: 10px !important;
padding-bottom: 10px !important;
}

*[class*="mobile-hide"] {
display: none !important;
}

*[class*="mobile-br"] {
font-size: 12px !important;
}

td[class*="mobile-w20"] {
width: 20px !important;
}

img[class*="mobile-w20"] {
width: 20px !important;
}

td[class*="mobile-center"] {
text-align: center !important;
}

table[class*="w100p"] {
width: 100% !important;
}

td[class*="activate-now"] {
padding-right: 0 !important;
padding-top: 20px !important;
}

td[class*="mobile-resize"] {
font-size: 22px !important;
padding-left: 15px !important;
}

}
Binary file added src/resources/assets/images/emails/background.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/resources/assets/images/emails/facebook.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/resources/assets/images/emails/googleplus.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/resources/assets/images/emails/twitter.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions src/resources/views/emails/layouts/main.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>{{$htmlTitle or ''}}</title>


@include('emails.partials.css')


<!-- Originally designed by https://github.com/kaytcat -->
<!-- Header image designed by Freepik.com -->

@yield('css')

</head>
<body offset="0" class="body"
style="padding:0; margin:0; display:block; background:#eeebeb; -webkit-text-size-adjust:none" bgcolor="#eeebeb">
<table align="center" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td align="center" valign="top" style="background-color:#eeebeb" width="100%">

<center>

<table cellspacing="0" cellpadding="0" width="600" class="w320">
<tr>
<td align="center" valign="top">

@include('emails.partials.header')

<table cellspacing="0" cellpadding="0" width="100%" class="force-full-width"
bgcolor="#ffffff">
<tr>
<td style="background-color:#ffffff;">
<br>
<center>
<table style="margin: 0 auto;" cellspacing="0" cellpadding="0" class="force-width-80">
<tr>
<td style="text-align:left; color: #6f6f6f;" class="spaced-out-lines">
@yield('content')
</td>
</tr>
</table>
</center>

<table style="margin:0 auto;" cellspacing="0" cellpadding="10" width="100%">
<tr>
<td style="text-align:center; margin:0 auto;">
<br>
<div>
<!--[if mso]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:w="urn:schemas-microsoft-com:office:word"
href="http://"
style="height:45px;v-text-anchor:middle;width:220px;"
stroke="f" fillcolor="#f5774e">
<w:anchorlock/>
<center>
<![endif]-->
@yield('buttons')
<!--[if mso]>
</center>
</v:rect>
<![endif]-->
</div>
<br>
</td>
</tr>
</table>

@include('emails.partials.footer')
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</body>
</html>
Loading

0 comments on commit 1f94fbf

Please sign in to comment.