• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

I'd like to modify the mail template

General Discussion
2
3
850
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K
    KevLav last edited by 14 Feb 2020, 10:59

    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.
    1 Reply Last reply Reply Quote 0
    • J
      Jyoti last edited by 14 Feb 2020, 11:35

      @KevLav
      Override the view file of mail. Refer this - https://forums.bagisto.com/topic/221/how-to-override-view-file-in-bagisto

      1 Reply Last reply Reply Quote 0
      • K
        KevLav last edited by 14 Feb 2020, 15:46

        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.

        1 Reply Last reply Reply Quote 0
        1 out of 3
        • First post
          1/3
          Last post