Skip to content

Commit

Permalink
✨ New object send mail
Browse files Browse the repository at this point in the history
  • Loading branch information
juzaweb committed Mar 30, 2021
1 parent 2d63c83 commit 64398a6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 53 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ EmailTemplate::create([

### Send email with template
```
use Theanh\EmailTemplate\Facades\EmailService;
use Theanh\EmailTemplate\EmailService;
EmailService::withTemplate('test_mail')
EmailService::make()
->withTemplate('test_mail')
->setEmails('test@example.com')
->setParams([
'name' => 'The Anh',
Expand Down
16 changes: 0 additions & 16 deletions src/Contracts/EmailServiceContract.php

This file was deleted.

10 changes: 9 additions & 1 deletion src/Helpers/EmailService.php → src/EmailService.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Theanh\EmailTemplate\Helpers;
namespace Theanh\EmailTemplate;

use Theanh\EmailTemplate\Models\EmailList;
use Theanh\EmailTemplate\Models\EmailTemplate;
Expand All @@ -14,6 +14,14 @@ class EmailService
protected $subject;
protected $body;

/**
* Make email service
* */
public static function make()
{
return new EmailService();
}

/**
* Set template for email by template code
*
Expand Down
6 changes: 0 additions & 6 deletions src/EmailTemplateServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\ServiceProvider;
use Theanh\EmailTemplate\Commands\SendMailCommand;
use Theanh\EmailTemplate\Contracts\EmailServiceContract;
use Theanh\EmailTemplate\Contracts\SendEmailServiceContract;
use Theanh\EmailTemplate\Helpers\EmailService;
use Theanh\EmailTemplate\Helpers\SendEmailService;

class EmailTemplateServiceProvider extends ServiceProvider
Expand All @@ -26,10 +24,6 @@ public function boot()

public function register()
{
$this->app->singleton(EmailServiceContract::class, function () {
return new EmailService();
});

$this->app->singleton(SendEmailServiceContract::class, function () {
return new SendEmailService();
});
Expand Down
28 changes: 0 additions & 28 deletions src/Facades/EmailService.php

This file was deleted.

0 comments on commit 64398a6

Please sign in to comment.