Add Tracking URL to shipping email template
-
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,])) }
-
Hi @SP,
May I know which Bagisto version are you using?
-
Hi, I'm using 1.2.0 currently
-
Hi @SP,
But the tracking number is already coming. You just need to add the tracking number in the admin panel.
-
@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 ? -
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]);
-
Hi @devansh-webkul ,
It's working. Thanks for your help!
-
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
-
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
-
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.