From 2cae5d984c7704b5fa7e176e01b3218a0e0f197f Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 13 Jun 2021 17:48:55 +1000 Subject: [PATCH] Add email template --- app/Classes/Protocol.php | 2 +- composer.json | 3 +- composer.lock | 62 +++- resources/images/mail-logo.png | Bin 0 -> 2271 bytes .../views/vendor/mail/html/header.blade.php | 12 + .../views/vendor/mail/html/layout.blade.php | 65 ++++ .../views/vendor/mail/html/themes/default.css | 305 ++++++++++++++++++ 7 files changed, 446 insertions(+), 3 deletions(-) create mode 100644 resources/images/mail-logo.png create mode 100644 resources/views/vendor/mail/html/header.blade.php create mode 100644 resources/views/vendor/mail/html/layout.blade.php create mode 100644 resources/views/vendor/mail/html/themes/default.css diff --git a/app/Classes/Protocol.php b/app/Classes/Protocol.php index 20840f0..d087888 100644 --- a/app/Classes/Protocol.php +++ b/app/Classes/Protocol.php @@ -16,7 +16,7 @@ abstract class Protocol // Our product code // @todo Move These to a config file protected const product_code = 'AB8D'; - protected const setup = 1; + public const setup = 1; // Enable extra debugging protected bool $DEBUG = FALSE; diff --git a/composer.json b/composer.json index 0f8a988..11f34c2 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,9 @@ "license": "MIT", "require": { "php": "^8.0", - "ext-sockets": "*", "ext-pcntl": "*", + "ext-sockets": "*", + "eduardokum/laravel-mail-auto-embed": "^1.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "laravel/framework": "^8.0", diff --git a/composer.lock b/composer.lock index 27f3f4f..a69b286 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "84a3cf3f8e76f0da1558274718fd1a7a", + "content-hash": "d362d42dec593149f79613fde5510165", "packages": [ { "name": "asm89/stack-cors", @@ -354,6 +354,65 @@ ], "time": "2020-11-24T19:55:57+00:00" }, + { + "name": "eduardokum/laravel-mail-auto-embed", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/eduardokum/laravel-mail-auto-embed.git", + "reference": "918c3aff220d965fbaee96ae4d48a09036381bdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/eduardokum/laravel-mail-auto-embed/zipball/918c3aff220d965fbaee96ae4d48a09036381bdf", + "reference": "918c3aff220d965fbaee96ae4d48a09036381bdf", + "shasum": "" + }, + "require": { + "illuminate/contracts": ">=5.3", + "illuminate/mail": ">=5.3", + "illuminate/support": ">=5.3", + "php": ">=5.5.0" + }, + "require-dev": { + "orchestra/testbench": "~3.0", + "phpunit/phpunit": "~5.0|~6.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Eduardokum\\LaravelMailAutoEmbed\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Eduardokum\\LaravelMailAutoEmbed\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gusmão", + "email": "eduguscontra3@hotmail.com" + } + ], + "description": "Library for embed images in emails automatically", + "homepage": "https://github.com/eduardokum/laravel-mail-auto-embed", + "keywords": [ + "eduardokum", + "laravel-mail-auto-embed" + ], + "support": { + "issues": "https://github.com/eduardokum/laravel-mail-auto-embed/issues", + "source": "https://github.com/eduardokum/laravel-mail-auto-embed/tree/master" + }, + "time": "2017-09-21T12:11:32+00:00" + }, { "name": "egulias/email-validator", "version": "2.1.25", @@ -8090,6 +8149,7 @@ "prefer-lowest": false, "platform": { "php": "^8.0", + "ext-pcntl": "*", "ext-sockets": "*" }, "platform-dev": [], diff --git a/resources/images/mail-logo.png b/resources/images/mail-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..849520c71bbc0ff9581a66bc060e3b9015531252 GIT binary patch literal 2271 zcmeAS@N?(olHy`uVBq!ia0y~yVD@8RU^>Ub3>3-njJpS=?Nk^)#sNw%$0gl~X?bAC~(f|;Iyo`I4bmx6+VO;JjkRgjAtR6CGo ztCUevQedU8UtV6WS8lAAUzDzIXlZGwZ(yWvWTXpJp<7&;SCUwvn^&w1F$89gOKNd) zQD#9&W`3Rm$lS!F{L&IzB_)tWZ~$>KW+6%?4_<0f|}# zWLBi+M7m_=rsfp`?XWX9w6FoI$B;qTh@>+Dq0_>|3|S|V47$$H;?yGN{9K@wC3eBd zMX5lmGxAHInvo@;8g2AJK1T`(NHBv%f#Gb&Wup&|GdnJ^yl2wDXyh#Lh%9Dc5K{$V zM$aIX4?scw0G|-o(9qCTt5yMd|Ns97QgL=%JPZtM<(@8%Ar-gY-pvhqWWdnyFwZ~X zHS3QX+zIO+{5`*Ab@I$q=gfT?f%CqLXK~H6Ib$Kkbl36z!gE3eLh62xRQ%=~@tkAP zIoYC6NWBo9yX9ia|7*pMj&usE`^~W^#KH(USKNnF60WagaqRXR4=W$T1uz*?Y$o?q z;jjc*_403XcWHga?ijGT+n@hPiCOp0-2d^DiF<`5Hb*0yr|xHeFjM1YD{fD$T+_04 z$-=(NpC(Mitq2}MD|cjWynHmN_D;tFpUgks-yQ4z9Xn4HSMVKq`EpL*<*a;h@tE>o zzpCU93-$2MRhnlD^52(;<)`+~#~SKz4{TW*e8jc8dP|`6uG7iE&rZXgfyr3uxx6^| zRolbR4TkQOXJ+!?bP`PKl}W*;q*}W}OLVrs*?GxS0FQ>{G8?vk%?>*ET(0@I@56_1 z=iz4Ta^C&)=h8Wg&s8n-X}O&E8O56`S6zPp{XDWz$aM8L#~$96SzfIphUSit!+!~a{~^Glnp5&!sRXZXc=sES~5i7@D8yJhQp*|=}B+8-9m-s(pSxm6Fh%>JLd zq56s^BT`;mbnSE7Ii|aQGl$&j@XCbP0 Hl+XkKVTZ+O literal 0 HcmV?d00001 diff --git a/resources/views/vendor/mail/html/header.blade.php b/resources/views/vendor/mail/html/header.blade.php new file mode 100644 index 0000000..5ace9c7 --- /dev/null +++ b/resources/views/vendor/mail/html/header.blade.php @@ -0,0 +1,12 @@ + + + + + + +
+ + +

{{ $slot }}

+
+
\ No newline at end of file diff --git a/resources/views/vendor/mail/html/layout.blade.php b/resources/views/vendor/mail/html/layout.blade.php new file mode 100644 index 0000000..4e6394d --- /dev/null +++ b/resources/views/vendor/mail/html/layout.blade.php @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + diff --git a/resources/views/vendor/mail/html/themes/default.css b/resources/views/vendor/mail/html/themes/default.css new file mode 100644 index 0000000..46f96cf --- /dev/null +++ b/resources/views/vendor/mail/html/themes/default.css @@ -0,0 +1,305 @@ +/* Base */ + +body, +body *:not(html):not(style):not(br):not(tr):not(code) { + box-sizing: border-box; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, + 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; + position: relative; +} + +body { + -webkit-text-size-adjust: none; + background-color: #000; + color: #eeeeee; + height: 100%; + line-height: 1.4; + margin: 0; + padding: 0; + width: 100% !important; +} + +p, +ul, +ol, +blockquote { + line-height: 1.4; + text-align: left; +} + +a { + color: #3869d4; +} + +a img { + border: none; +} + +/* Typography */ + +h1 { + color: #eeeeee; + font-size: 35px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +h2 { + font-size: 16px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +h3 { + font-size: 14px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +p { + font-size: 16px; + line-height: 1.5em; + margin-top: 0; + text-align: left; +} + +p.sub { + font-size: 12px; +} + +img { + max-width: 100%; +} + +/* Layout */ + +.wrapper { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + background-color: #000; + margin: 0; + padding: 0; + width: 100%; +} + +.content { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + margin: 0; + padding: 0; + width: 100%; +} + +/* Header */ + +.header { + padding: 25px 0; + text-align: center; + margin: 0 auto; + width: 570px; +} + +.header a { + color: #eeeeee; + font-size: 19px; + font-weight: bold; + text-decoration: none; +} + +/* Logo */ + +.logo { + height: 100px; + max-height: 100px; +} + +/* Body */ + +.body { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + background-color: #000; + border-bottom: 1px solid #000; + border-top: 1px solid #000; + margin: 0; + padding: 0; + width: 100%; +} + +.inner-header { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 570px; + background-color: #000; + border-color: #000; + border-radius: 2px; + border-width: 1px; + box-shadow: 0 2px 0 rgba(0, 0, 150, 0.025), 2px 4px 0 rgba(0, 0, 150, 0.015); + margin: 0 auto; + padding: 0; + width: 570px; +} + +.inner-body { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 570px; + background-color: #222222; + border-color: #00ff00; + border-radius: 2px; + border-width: 1px; + box-shadow: 0 2px 0 rgba(0, 0, 150, 0.025), 2px 4px 0 rgba(0, 0, 150, 0.015); + margin: 0 auto; + padding: 0; + width: 570px; +} + +/* Subcopy */ + +.subcopy { + border-top: 2px solid #eeeeee; + margin-top: 25px; + padding-top: 25px; +} + +.subcopy p { + font-size: 14px; +} + +/* Footer */ + +.footer { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 570px; + margin: 0 auto; + padding: 0; + text-align: center; + width: 570px; +} + +.footer p { + color: #b0adc5; + font-size: 12px; + text-align: center; +} + +.footer a { + color: #b0adc5; + text-decoration: underline; +} + +/* Tables */ + +.table table { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + margin: 30px auto; + width: 100%; +} + +.table th { + border-bottom: 1px solid #eeeeee; + margin: 0; + padding-bottom: 8px; +} + +.table td { + color: #eeeeee; + font-size: 15px; + line-height: 18px; + margin: 0; + padding: 10px 0; +} + +.content-cell { + max-width: 100vw; + padding: 32px; +} + +/* Buttons */ + +.action { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + margin: 30px auto; + padding: 0; + text-align: center; + width: 100%; +} + +.button { + -webkit-text-size-adjust: none; + border-radius: 4px; + color: #fff; + display: inline-block; + overflow: hidden; + text-decoration: none; +} + +.button-blue, +.button-primary { + background-color: #2d3748; + border-bottom: 8px solid #2d3748; + border-left: 18px solid #2d3748; + border-right: 18px solid #2d3748; + border-top: 8px solid #2d3748; +} + +.button-green, +.button-success { + background-color: #48bb78; + border-bottom: 8px solid #48bb78; + border-left: 18px solid #48bb78; + border-right: 18px solid #48bb78; + border-top: 8px solid #48bb78; +} + +.button-red, +.button-error { + background-color: #e53e3e; + border-bottom: 8px solid #e53e3e; + border-left: 18px solid #e53e3e; + border-right: 18px solid #e53e3e; + border-top: 8px solid #e53e3e; +} + +/* Panels */ + +.panel { + border-left: #3f6982 solid 5px; + margin: 21px 0; +} + +.panel-content { + background-color: #edf2f7; + color: #2f373e; + padding: 16px; +} + +.panel-content p { + color: #2f373e; +} + +.panel-item { + padding: 0; +} + +.panel-item p:last-of-type { + margin-bottom: 0; + padding-bottom: 0; +} + +/* Utilities */ + +.break-all { + word-break: break-all; +}