Fixed: return letter path in mail
This commit is contained in:
parent
ef537b919e
commit
13ad5ea55c
|
@ -6,10 +6,9 @@ use App\Letter\BillKind;
|
|||
use App\Letter\DocumentFactory;
|
||||
use App\Letter\Queries\BillKindQuery;
|
||||
use App\Payment\PaymentMail;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Lorisleiva\Actions\Concerns\AsAction;
|
||||
use Mail;
|
||||
use Zoomyboy\Tex\Tex;
|
||||
|
||||
class LetterSendAction
|
||||
|
@ -37,7 +36,7 @@ class LetterSendAction
|
|||
$letters = app(DocumentFactory::class)->letterCollection($type, new BillKindQuery(BillKind::EMAIL));
|
||||
|
||||
foreach ($letters as $letter) {
|
||||
$letterPath = Storage::path(Tex::compile($letter)->storeIn('/tmp', 'local'));
|
||||
$letterPath = Storage::disk('temp')->path(Tex::compile($letter)->storeIn('', 'temp'));
|
||||
Mail::to($letter->getRecipient())
|
||||
->send(new PaymentMail($letter, $letterPath));
|
||||
app(DocumentFactory::class)->afterSingle($letter);
|
||||
|
|
|
@ -9,8 +9,8 @@ use App\Payment\Payment;
|
|||
use App\Payment\PaymentMail;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Mail;
|
||||
use Tests\RequestFactories\Child;
|
||||
use Tests\TestCase;
|
||||
use Zoomyboy\Tex\Tex;
|
||||
|
@ -25,7 +25,7 @@ class LetterSendActionTest extends TestCase
|
|||
{
|
||||
parent::setUp();
|
||||
|
||||
Storage::fake('local');
|
||||
Storage::fake('temp');
|
||||
$this->withoutExceptionHandling();
|
||||
$this->login()->loginNami();
|
||||
$this->member = Member::factory()
|
||||
|
@ -43,7 +43,7 @@ class LetterSendActionTest extends TestCase
|
|||
|
||||
Artisan::call('letter:send');
|
||||
|
||||
Mail::assertSent(PaymentMail::class, fn ($mail) => Storage::path('rechnung-fur-mom.pdf') === $mail->filename);
|
||||
Mail::assertSent(PaymentMail::class, fn ($mail) => Storage::disk('temp')->path('rechnung-fur-mom.pdf') === $mail->filename && Storage::disk('temp')->exists('rechnung-fur-mom.pdf'));
|
||||
}
|
||||
|
||||
public function testItCanCompileAttachment(): void
|
||||
|
|
Loading…
Reference in New Issue