-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2956 from notbakaneko/feature/store/confirmation-…
…mail Send order confirmation mail after store payment received
- Loading branch information
Showing
4 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright 2015-2018 ppy Pty. Ltd. | ||
* | ||
* This file is part of osu!web. osu!web is distributed with the hope of | ||
* attracting more community contributions to the core ecosystem of osu!. | ||
* | ||
* osu!web is free software: you can redistribute it and/or modify | ||
* it under the terms of the Affero GNU General Public License version 3 | ||
* as published by the Free Software Foundation. | ||
* | ||
* osu!web is distributed WITHOUT ANY WARRANTY; without even the implied | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with osu!web. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace App\Mail; | ||
|
||
use App\Models\Store\Order; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class StorePaymentCompleted extends Mailable implements ShouldQueue | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
private $params; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(Order $order) | ||
{ | ||
$this->params = [ | ||
'order' => $order, | ||
]; | ||
} | ||
|
||
/** | ||
* Build the message. | ||
* | ||
* @return $this | ||
*/ | ||
public function build() | ||
{ | ||
return $this->text(i18n_view('emails.store.payment_completed')) | ||
->with($this->params) | ||
->from('osustore@ppy.sh', 'osu!store team') | ||
->subject(trans('store.mail.payment_completed.subject')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
resources/views/emails/store/payment_completed-en.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{{-- | ||
Copyright 2015-2018 ppy Pty. Ltd. | ||
This file is part of osu!web. osu!web is distributed with the hope of | ||
attracting more community contributions to the core ecosystem of osu!. | ||
osu!web is free software: you can redistribute it and/or modify | ||
it under the terms of the Affero GNU General Public License version 3 | ||
as published by the Free Software Foundation. | ||
osu!web is distributed WITHOUT ANY WARRANTY; without even the implied | ||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with osu!web. If not, see <http://www.gnu.org/licenses/>. | ||
--}} | ||
|
||
Hi {{ $order->user->username }}, | ||
|
||
Thanks for your osu!store order! | ||
|
||
@foreach ($order->items as $item) | ||
{{ $item->quantity }} x {{ $item->getDisplayName() }} ({{ currency($item->subtotal()) }}) | ||
@endforeach | ||
|
||
@if ($order->shipping > 0) | ||
Shipping ({{ currency($order->shipping) }}) | ||
@endif | ||
Total ({{ currency($order->getTotal()) }}) | ||
|
||
@if ($order->requiresShipping()) | ||
We have received your payment and are preparing your order for shipping. It may take a few days for us to send it out, depending on the quantity of orders. You can follow the progress of your order at {{ route('store.invoice.show', $order) }}, including tracking details where available. | ||
@else | ||
We have received your payment and are currently processing your order. You can follow the progress of your order at {{ route('store.invoice.show', $order) }}. | ||
@endif | ||
|
||
If you have any questions, don't hesitate to reply to this email. | ||
|
||
Regards, | ||
The osu!store team |