Skip to content

Commit

Permalink
Update readme and separate email footer parts
Browse files Browse the repository at this point in the history
  • Loading branch information
cannycookie committed Sep 9, 2023
1 parent 9c3896d commit 3547bb9
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 35 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

We use the standard Laravel mail sending capability, the package simply allows content editing and faster adding of new templates.

![Email Preview](./guides/TemplateScreenShot.png)
![Email Preview](./media/ThemeEditor.png)

## Installation

Expand Down Expand Up @@ -66,7 +66,7 @@ You can publish EmailTemplateResource to your project. Run the command given bel

### HTML Editor
Edit email content in the admin and use tokens to inject model or config content.
![Email Preview](./guides/EmailEditor.png)
![Email Preview](./media/EmailEditor.png)

Note: The seeder can also be edited directly if you wish to prepopulate with your own content.
`Database\Seeders\EmailTemplateSeeder.php`
Expand Down
Binary file added media/ThemeEditor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion resources/views/email/default_preview.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

<?php $data['theme'] = $this->data['colours'] ?>

<div style="background-color: {{$data['theme']["body_bg_color"]}};">

@include('vb-email-templates::email.parts._body')

Expand All @@ -12,5 +13,5 @@

@include('vb-email-templates::email.parts._footer')


</div>

63 changes: 34 additions & 29 deletions resources/views/email/parts/_footer.blade.php
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
<!-- FOOTER -->
<tr>
<td bgcolor="{{$data['theme']["footer_bg_color"]}}" align="center" style="padding: 0px 10px 0px 10px;">
<!--[if (gte mso 9)|(IE)]>
<td bgcolor="{{$data['theme']["footer_bg_color"]}}" align="center" style="padding: 0px 10px 0px 10px;">
<!--[if (gte mso 9)|(IE)]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="{{config('email-templates.content_width')}}">
<tr>
<td align="center" valign="top" width="{{config('email-templates.content_width')}}">
<![endif]-->
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: {{config('email-templates.content_width')}}px; margin-bottom: 30px" >
<!-- NAVIGATION -->
<tr>
<td bgcolor="{{$data['theme']["body_bg_color"]}}" align="left" style="padding: 30px 30px 30px 30px; color: {{$data['theme']["body_color"]}}; border-radius: 4px 4px 4px 4px;
font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 400; line-height: 18px;" >
<p style="margin: 0;">
@foreach(config('email-templates.links') as $link)
<a href="{{$link['url']}}" target="_blank" style="font-weight: 700;" title="{{$link['title']}}">{{$link['name']}}</a>
@if(! $loop->last) | @endif
@endforeach
</p>
</td>
</tr>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: {{config('email-templates.content_width')}}px;">
<!-- NAVIGATION -->
<tr>
<td bgcolor="{{$data['theme']["body_bg_color"]}}" align="left" style="padding: 30px; color: {{$data['theme']["body_color"]}}; border-radius: 4px 4px 4px 4px;
font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 400; line-height: 18px;">
<p style="margin: 0;">
@foreach(config('email-templates.links') as $link)
<a href="{{$link['url']}}" target="_blank" style="font-weight: 700;" title="{{$link['title']}}">{{$link['name']}}</a>
@if(! $loop->last)
|
@endif
@endforeach
</p>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: {{config('email-templates.content_width')}}px; margin: 20px 0">

<!-- ADDRESS -->
<tr>
<td bgcolor="{{$data['theme']["body_bg_color"]}}" align="left" style="padding: 0px 30px 30px 30px; color: {{$data['theme']["body_color"]}}; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 400; line-height: 18px;" >
<hr>
<p> &copy; <?= date('Y'); ?> {{config('app.name')}}. {{__('vb-email-templates::email-templates.general-labels.all-rights-reserved')}}.</p>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
<!-- ADDRESS -->
<tr>
<td bgcolor="{{$data['theme']["body_bg_color"]}}" align="left"
style="padding: 30px; color: {{$data['theme']["body_color"]}}; border-radius: 4px 4px 4px 4px; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 14px;
font-weight: 400; line-height: 18px;">
<p style="margin: 0;"> &copy; <?= date('Y'); ?> {{config('app.name')}}. {{__('vb-email-templates::email-templates.general-labels.all-rights-reserved')}}.</p>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>

2 changes: 1 addition & 1 deletion resources/views/forms/components/iframe.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<iframe
src="data:text/html;base64,{{ $record->getBase64EmailPreviewData() }}"
style="width: {{ $width??'100%' }}; height: {{ $height??'100vh;' }}"
style="width: {{ $width??'100%' }}; height: 100%"
name="{{ $name??'' }}"
>
{{__('vb-email-templates::email-templates.general-labels.browser-not-compatible')}}
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/EmailTemplateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static function form(Form $form): Form
TiptapEditor::make('content')
->label(__('vb-email-templates::email-templates.form-fields-labels.content'))
->profile('default')
->default("<p>Dear ##user.firstname##, </p>"),
->default("<p>Dear ##user.firstname##, </p>"),
]
),

Expand Down Expand Up @@ -175,7 +175,7 @@ public static function table(Table $table): Table
->body("<span style='overflow-wrap: anywhere;'>".$notify->body."</span>")
->send();
}),
Tables\Actions\ViewAction::make('Preview')
Action::make('Preview')
->icon('heroicon-o-magnifying-glass')
->modalContent(fn (EmailTemplate $record): View => view(
'vb-email-templates::forms.components.iframe',
Expand Down

0 comments on commit 3547bb9

Please sign in to comment.