Bagisto Forum

    Bagisto

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

    Add Tracking URL to shipping email template

    General Discussion
    3
    10
    1229
    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.
    • S
      SP last edited by

      May I know how do I add a tracking URL in the shipping email template? I was trying to add the code inside NewShipmentNotification.php but I'm not sure how to pass it into the view template?

      public function build()
          {
              $order = $this->shipment->order;
              $carrier = $order->carrier_title;
              $carrier_url = "";
              $track_number = $order->track_number;
              if($carrier == "lalamove" && $track_number != ""){
                  $carrier_url = "https://track.aftership.com/trackings?courier=lalamove&tracking-numbers=" . $track_number;
              }else if($carrier == "pickup"){
                  $carrier_url = "https://sg.pickupp.io/en/tracking";
              }
              return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name'])
                          ->to($order->customer_email, $order->customer_full_name)
                          ->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->increment_id,]))
              }
      
      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        Hi @SP,

        May I know which Bagisto version are you using?

        1 Reply Last reply Reply Quote 0
        • S
          SP last edited by

          Hi, I'm using 1.2.0 currently

          1 Reply Last reply Reply Quote 0
          • devansh-webkul
            devansh-webkul last edited by

            Hi @SP,

            But the tracking number is already coming. You just need to add the tracking number in the admin panel.

            https://github.com/bagisto/bagisto/blob/9a7315a4c7e37e428321231d0cfc9c4590e9d609/packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php#L75

            S 1 Reply Last reply Reply Quote 0
            • S
              SP @devansh-webkul last edited by

              @devansh-webkul said in Add Tracking URL to shipping email template:

              ust need to add the tracking number in the admin panel.

              Hi @devansh-webkul ,
              but I want to add pass another URL field in the email template, may I know where can I add the code and pass it to the email template ?

              1 Reply Last reply Reply Quote 0
              • devansh-webkul
                devansh-webkul last edited by

                Hi @SP,

                Just chain your method with a view,

                return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name'])
                                  ->to($order->customer_email, $order->customer_full_name)
                                  ->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->increment_id,]))
                                 ->view('shop::emails.sales.new-shipment', ['track_number' => $track_number, 'carrier_url' => $carrier_url]);
                
                S Z 2 Replies Last reply Reply Quote 0
                • S
                  SP @devansh-webkul last edited by

                  Hi @devansh-webkul ,

                  It's working. Thanks for your help!

                  1 Reply Last reply Reply Quote 0
                  • devansh-webkul
                    devansh-webkul last edited by

                    Hi @SP,

                    Thanks for the update.

                    Also, if you like our support, you may give us the review here:- https://www.trustpilot.com/review/bagisto.com

                    That would be grateful for us.

                    Thanks & Regards,

                    Bagisto Team

                    1 Reply Last reply Reply Quote 0
                    • Z
                      Zaeem2 @devansh-webkul last edited by

                      @devansh-webkul

                      I need your help, sir. I want to add a courier tracking system to my website. I have placed iframes on my website, but I don't really like them. Can you tell me how to add a tracking system on my website.

                      best regards

                      1 Reply Last reply Reply Quote 0
                      • devansh-webkul
                        devansh-webkul last edited by

                        @Zaeem2,

                        Sorry, I am not getting which tracking system are you adding. Mostly all these things come up with the docs. Just check and try to integrate.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post