Skip to content

Commit

Permalink
added configurable links
Browse files Browse the repository at this point in the history
  • Loading branch information
cannycookie committed Jul 8, 2023
1 parent bf7092b commit 443f0de
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 19 deletions.
32 changes: 20 additions & 12 deletions config/email-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,35 @@
'logo' => 'media/email-templates/logo.png',

//Logo size in pixels -> 200 pixels high is plenty big enough.
'logo_width' => '200',
'logo_height' => '200',
'logo_width' => '476',
'logo_height' => '117',

//Content Width in Pixels
'content_width' => '600',

//Background Colours
'header_bg_color' => '#424242',
'header_bg_color' => '#B8B8D1',
'body_bg_color' => '#f4f4f4',
'content_bg_color' => '#fefefe',
'footer_bg_color' => '#646464',
'callout_bg_color' => '#700000',
'button_bg_color' => '#424242',
'content_bg_color' => '#FFFFFB',
'footer_bg_color' => '#5B5F97',
'callout_bg_color' => '#B8B8D1',
'button_bg_color' => '#FFC145',

//Text Colours
'body_color' => '#333333',
'callout_color' => '#ffffff',
'button_color' => '#ffffff',
'anchor_color' => '#ff7978',
'callout_color' => '#000000',
'button_color' => '#2A2A11',
'anchor_color' => '#4c05a1',

//Contact details included in default email templates
'customer-services-email'=>'support@yourcompany.com',
'customer-services-phone'=>'+441273 455702',

//Footer Links
'links' =>[
['name'=>'Website','url'=>'https://yourwebsite.com','title'=>'Goto website'],
['name'=>'Privacy Policy','url'=>'https://yourwebsite.com/privacy-policy','title'=>'View Privacy Policy'],
],

//Options for alternative languages
//Note that Laravel default locale is just 'en'
Expand Down Expand Up @@ -79,6 +89,4 @@
'password_reset_success' => true,
],

//Contact details included in default email templates
'customer-services'=>'support@yourcompany.com'
];
Binary file modified media/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions refresh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
#For developer to remove and reinstall the package overwriting the previous views and config.
php artisan vendor:publish --tag=filament-email-templates-config --force
php artisan vendor:publish --tag=filament-email-templates-migrations --force
php artisan vendor:publish --tag=filament-email-templates-seeds --force
php artisan vendor:publish --tag=vb-email-templates-views --force
php artisan vendor:publish --tag=filament-email-templates-media --force
1 change: 1 addition & 0 deletions reinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ php artisan vendor:publish --tag=filament-email-templates-config --force
php artisan vendor:publish --tag=filament-email-templates-migrations --force
php artisan vendor:publish --tag=filament-email-templates-seeds --force
php artisan vendor:publish --tag=vb-email-templates-views --force
php artisan vendor:publish --tag=filament-email-templates-media --force

php artisan migrate:fresh --seed
php artisan db:seed --class=EmailTemplateSeeder
Expand Down
8 changes: 5 additions & 3 deletions resources/views/email/parts/_footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
<td bgcolor="{{config('email-templates.body_bg_color')}}" align="left" style="padding: 30px 30px 30px 30px; color: {{config('email-templates.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;">
<a href="{{config('app.url')}}" target="_blank" style="font-weight: 700;">{{__('vb-email-templates::email-templates.general-labels.website')}}</a> |
<a href="{{config('app.url')}}/privacy-policy" target="_blank" style=" font-weight: 700;">{{__('vb-email-templates::email-templates.general-labels.privacy-policy')}}</a>
@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>
Expand All @@ -36,4 +38,4 @@
</table>

</body>
</html>
</html>
13 changes: 9 additions & 4 deletions resources/views/email/parts/_support_block.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
<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" >
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: {{config('email-templates.content_width')}}px; margin-bottom: 30px">
<!-- HEADLINE -->
<tr>
<td bgcolor="{{config('email-templates.callout_bg_color')}}" align="center" style="padding: 30px 30px 30px 30px; border-radius: 4px 4px 4px 4px; color:{{config('email-templates.callout_color')}}; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;" >
<td bgcolor="{{config('email-templates.callout_bg_color')}}" align="center"
style="padding: 30px 30px 30px 30px; border-radius: 4px 4px 4px 4px; color:{{config('email-templates.callout_color')}}; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;">
<h2 style="font-size: 20px; font-weight: 400; color: {{config('email-templates.callout_color')}}; margin: 0;">{{__('vb-email-templates::email-templates.general-labels.need-help')}}</h2>
<p style="margin: 0; color: {{config('email-templates.callout_color')}}; ">{{__('vb-email-templates::email-templates.general-labels.call-support')}} <a href="tel:xxx-xxx-xxxx-xxx" target="_blank">xxx-xxx-xxxx-xxx</a></p>
<p style="margin: 0; color: {{config('email-templates.callout_color')}}; ">{{__('vb-email-templates::email-templates.general-labels.call-support')}}
<a href="tel:{{config('email-templates.customer-services-phone')}}" target="_blank">
{{config('email-templates.customer-services-phone')}}
</a>
</p>
</td>
</tr>
</table>
Expand All @@ -21,4 +26,4 @@
</table>
<![endif]-->
</td>
</tr>
</tr>

0 comments on commit 443f0de

Please sign in to comment.