I'd like to modify the mail template
-
In the file Webkul\Admin\Mail\NewOrderNotification.php you have the code.
* Build the message. * * @return $this */ public function build() { return $this->to($this->order->customer_email, $this->order->customer_full_name) ->from(config('mail.from')) ->subject(trans('shop::app.mail.order.subject')) ->view('shop::emails.sales.new-order'); }
I'd like to overwrite this to my own view.
How can I do this?
Things i've tried:
- Trying to overwrite events
<?php namespace Laveto\Aroma\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Event; use \Webkul\Admin\Providers\EventServiceProvider as WebkulEventServiceProvider; class EventServiceProvider extends WebkulEventServiceProvider { /** * Bootstrap services. * * @return void */ public function boot() { Event::listen('checkout.order.save.after', 'Laveto\Aroma\Listeners\Order@sendNewOrderMail'); } }
- Overwrite admin service provider (and trying to remove the
$this->app->register(EventServiceProvider::class)
). And keep of the rest of the code the same.
-
@KevLav
Override the view file of mail. Refer this - https://forums.bagisto.com/topic/221/how-to-override-view-file-in-bagisto -
Thanks, although this does work great. Can I edit it in my own package? *if not this is fine, but it's just a bit nicer. Since i've used my own package for all other things.