Skip to content

Commit 6178277

Browse files
committed
wip
1 parent 1c7a280 commit 6178277

19 files changed

+672
-34
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
/phpunit.xml.dist export-ignore
99
/.scrutinizer.yml export-ignore
1010
/tests export-ignore
11+
/docs export-ignore
1112
/.editorconfig export-ignore

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,73 @@
11
# HELO Laravel
2+
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/beyondcode/helo-laravel.svg?style=flat-square)](https://packagist.org/packages/beyondcode/helo-laravel)
4+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/beyondcode/helo-laravel/run-tests?label=tests)
5+
[![Quality Score](https://img.shields.io/scrutinizer/g/beyondcode/helo-laravel.svg?style=flat-square)](https://scrutinizer-ci.com/g/beyondcode/helo-laravel)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/beyondcode/helo-laravel.svg?style=flat-square)](https://packagist.org/packages/beyondcode/helo-laravel)
7+
8+
The helper package to add additional debug information from Laravel to your [HELO](https://usehelo.com) mails.
9+
10+
## Documentation
11+
12+
To install this package, require it via composer:
13+
14+
```bash
15+
composer require --dev beyondcode/helo-laravel
16+
```
17+
18+
You can also publish the package configuration using:
19+
20+
```bash
21+
php artisan vendor:publish --provider="BeyondCode\HeloLaravel\HeloLaravelServiceProvider"
22+
```
23+
24+
This will create a config file called `helo.php` with the following content:
25+
26+
```php
27+
<?php
28+
29+
return [
30+
/**
31+
* This flag determines if you want to send additional SMTP headers that will contain the debug output that HELO
32+
* makes use of.
33+
* By default, this is only the case when your application is in debug mode.
34+
*/
35+
'is_enabled' => env('HELO_ENABLED', env('APP_DEBUG')),
36+
];
37+
```
38+
39+
## Using the package
40+
41+
When the package is enabled in your Laravel application, all mailables that you send via your application will contain additional SMTP headers with debug information, that [HELO](https://usehelo.com) will display in the UI.
42+
Please refer to the HELO documentation in order to setup your application to send mails to HELO.
43+
44+
Once HELO accepts emails from your application, you can try if the package works, using the built-in test command:
45+
46+
```
47+
php artisan helo:test
48+
```
49+
50+
A test message should appear in your HELO UI containing additional debug information:
51+
52+
![](./docs/helo.png)
53+
54+
### Changelog
55+
56+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
57+
58+
## Contributing
59+
60+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
61+
62+
### Security
63+
64+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
65+
66+
## Credits
67+
68+
- [Marcel Pociot](https://github.com/mpociot)
69+
- [All Contributors](../../contributors)
70+
71+
## License
72+
73+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
],
1818
"require": {
1919
"php": "^7.3",
20+
"illuminate/view": "^6.0|^7.0",
21+
"illuminate/console": "^6.0|^7.0",
2022
"illuminate/mail": "^6.0|^7.0"
2123
},
2224
"require-dev": {
23-
"larapack/dd": "^1.0",
25+
"orchestra/testbench": "^5.1",
2426
"phpunit/phpunit": "^8.0"
2527
},
2628
"autoload": {

config/helo.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
return [
4+
/**
5+
* This flag determines if you want to send additional SMTP headers that will contain the debug output that HELO
6+
* makes use of.
7+
* By default, this is only the case when your application is in debug mode.
8+
*/
9+
'is_enabled' => env('HELO_ENABLED', env('APP_DEBUG')),
10+
];

resources/views/email.blade.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@component('helo::layout.message')
2+
# HELO
3+
4+
This email was sent from your Laravel application.
5+
6+
Enjoy debugging
7+
8+
Thanks,<br>
9+
Marcel & Sebastian from Beyond Code
10+
@endcomponent
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<table class="action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
2+
<tr>
3+
<td align="center">
4+
<table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
5+
<tr>
6+
<td align="center">
7+
<table border="0" cellpadding="0" cellspacing="0" role="presentation">
8+
<tr>
9+
<td>
10+
<a href="{{ $url }}" class="button button-{{ $color ?? 'primary' }}" target="_blank" rel="noopener">{{ $slot }}</a>
11+
</td>
12+
</tr>
13+
</table>
14+
</td>
15+
</tr>
16+
</table>
17+
</td>
18+
</tr>
19+
</table>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<tr>
2+
<td>
3+
<table class="footer" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
4+
<tr>
5+
<td class="content-cell" align="center">
6+
{{ Illuminate\Mail\Markdown::parse($slot) }}
7+
</td>
8+
</tr>
9+
</table>
10+
</td>
11+
</tr>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<tr>
2+
<td class="header">
3+
<a href="{{ $url }}" style="display: inline-block;">
4+
@if (trim($slot) === 'Laravel')
5+
<img src="https://laravel.com/img/notification-logo.png" class="logo" alt="Laravel Logo">
6+
@else
7+
{{ $slot }}
8+
@endif
9+
</a>
10+
</td>
11+
</tr>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
5+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6+
</head>
7+
<body>
8+
<style>
9+
@media only screen and (max-width: 600px) {
10+
.inner-body {
11+
width: 100% !important;
12+
}
13+
14+
.footer {
15+
width: 100% !important;
16+
}
17+
}
18+
19+
@media only screen and (max-width: 500px) {
20+
.button {
21+
width: 100% !important;
22+
}
23+
}
24+
</style>
25+
26+
<table class="wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation">
27+
<tr>
28+
<td align="center">
29+
<table class="content" width="100%" cellpadding="0" cellspacing="0" role="presentation">
30+
{{ $header ?? '' }}
31+
32+
<!-- Email Body -->
33+
<tr>
34+
<td class="body" width="100%" cellpadding="0" cellspacing="0">
35+
<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
36+
<!-- Body content -->
37+
<tr>
38+
<td class="content-cell">
39+
{{ Illuminate\Mail\Markdown::parse($slot) }}
40+
41+
{{ $subcopy ?? '' }}
42+
</td>
43+
</tr>
44+
</table>
45+
</td>
46+
</tr>
47+
48+
{{ $footer ?? '' }}
49+
</table>
50+
</td>
51+
</tr>
52+
</table>
53+
</body>
54+
</html>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@component('helo::layout.layout')
2+
{{-- Header --}}
3+
@slot('header')
4+
@component('helo::layout.header', ['url' => 'https://usehelo.com'])
5+
HELO
6+
@endcomponent
7+
@endslot
8+
9+
{{-- Body --}}
10+
{{ $slot }}
11+
12+
{{-- Subcopy --}}
13+
@isset($subcopy)
14+
@slot('subcopy')
15+
@component('helo::layout.subcopy')
16+
{{ $subcopy }}
17+
@endcomponent
18+
@endslot
19+
@endisset
20+
21+
{{-- Footer --}}
22+
@slot('footer')
23+
@component('helo::layout.footer')
24+
© {{ date('Y') }} HELO. @lang('All rights reserved.')
25+
@endcomponent
26+
@endslot
27+
@endcomponent

0 commit comments

Comments
 (0)