Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Disable in_transit email

Featured Replies

How do i disable the in_transit email so the customer do not receive the email everytime i insert a trackingnumber for an order?

The problem was solved by following @wakabayashi 's suggestion by editing AdminOrdersController.php in /public_html/controllers/admin/.

Change:

if (@Mail::Send( (int) $order->id_lang, 'in_transit', Mail::l('Package in transit', (int) $order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop )) { Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else { $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.'); }

To

Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);

Maybe this topic is intresting for you too: https://forum.thirtybees.com/topic/1381/brainstorming-handling-orders-in-bo/20 I am talking a bit about emails too.

  • Author

Hello @wakabayashi

What exactly would you suggest with the "if (1==1) {}" ?

The code looks like this:

if (@Mail::Send( (int) $order->id_lang, 'in_transit', Mail::l('Package in transit', (int) $order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop )) {

Sorry forget my answer before...

Change this: if (@Mail::Send( (int) $order->id_lang, 'in_transit', Mail::l('Package in transit', (int) $order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop )) { Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else { $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.'); }

To: Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);

I have tried this solution. So please test it out!

  • Author

I get a 500 server error with that code when i go to Backoffice - Orders

  • Author

It works now, thank you very much.

I changed: if (@Mail::Send( (int) $order->id_lang, 'in_transit', Mail::l('Package in transit', (int) $order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop )) { Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else { $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.'); }

To

Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);

  • Author

Yes, it works perfect with no errors and no in_transit email.

  • 6 months later...

sorry, this should be here: https://forum.thirtybees.com/topic/1542/recaptcha-module-confirmation-unknown-message/26 (i opened both tabs in Chrome and sent it at the wrong, sorry)

I think it is very important to note in such threads that modifying core code directly is not recommended and won't survive future TB/core updates (manual copying of modifications is required when upgrading). It's always best to use overrides when possible.

It’s always best to use overrides when possible.

Best is to get bug fixes into core. Which requires a fairly clear description of what the actual problem is, together with the changed files in an issue report.

@traumflug said in Disable in_transit email:

It’s always best to use overrides when possible.

Best is to get bug fixes into core. Which requires a fairly clear description of what the actual problem is, together with the changed files in an issue report.

Of course, but this is not a bug as far as I understand, and as lesley pointed out above.

  • 1 year later...
On 8/28/2018 at 11:50 AM, Traumflug said:

It’s always best to use overrides when possible.

Best is to get bug fixes into core. Which requires a fairly clear description of what the actual problem is, together with the changed files in an issue report.

Sorry for reviving this old thread, just wanted to add my 2 cents.

In my opinion this is a bug as the in_transit status and e-mail are hard coded instead of being an actual order status (that could then easily be disabled) with attached e-mail.
So what happens is at the moment you add a tracking number it sends the in_transit e-mail to your customers, when you change the shipping status to ´sent´ it then sends the shipped status e-mail.

This means customers get 2 e-mails in a row where the in_transit e-mail is then useless.

@Leaton thats correct. I have changed this behaviour in our shop. It will only send one email and if there is a tracking code it will add it to the email...

Depending on the new TB team, I will maybe add a PR, to make this the default behaviour.

  • 1 year later...

 

14 minutes ago, AndyC said:

Also waiting for a solution.. Want to disable sending a email when entering a number

Hi Andy, the solution is to edit the files as noted by wakabayashi - it seems it was still not recognized as being a bug after all this time but take in account that with any update you might lose the edit so it's best to do it as an override as noted by doclucas

On 1/24/2018 at 4:13 PM, Minik said:

How do i disable the in_transit email so the customer do not receive the email everytime i insert a trackingnumber for an order?

The problem was solved by following @wakabayashi 's suggestion by editing AdminOrdersController.php in /public_html/controllers/admin/.

Change:

if (@Mail::Send( (int) $order->id_lang, 'in_transit', Mail::l('Package in transit', (int) $order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop )) { Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else { $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.'); }

To

Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);

15 minutes ago, Leaton said:

 

Hi Andy, the solution is to edit the files as noted by wakabayashi - it seems it was still not recognized as being a bug after all this time but take in account that with any update you might lose the edit so it's best to do it as an override as noted by doclucas

Yes, it's not recognised as a bug. This is expected and wanted behaviour. Some merchants would be angry if we removed this functionality, actually.

As was suggested above -- you can modify the core file, or create an override.

But you can also install my consequences module, and create rule that will block sending this particular email from your store:

image.png.a46d1bc62796a9c3f560ad0dd7f47aba.png

 

7 minutes ago, datakick said:

Yes, it's not recognised as a bug. This is expected and wanted behaviour. Some merchants would be angry if we removed this functionality, actually.

As was suggested above -- you can modify the core file, or create an override.

But you can also install my consequences module, and create rule that will block sending this particular email from your store:

image.png.a46d1bc62796a9c3f560ad0dd7f47aba.png

 

The reason I see it as being a bug is that it should be a shipping status that can be easily dissabled or editted without editting core files or using extra modules. I think that would make a lot more sense.

Edited by Leaton

I would like to have the in transit email sent out when I set the tracking number in BO. But I would like to have Sent out option and the in transit status somehow merged.

Now I have to manually change the status to Sent out (which sends out an email by default). Then I have to put in tracking number (this sends almost the same email, same title, etc with the only one line added - the tracking URL.

I would like to have this in single action, I doubt it could be done so I have disabled the Sent out email and the customer receive only 1 email with tracking number which states that the order is shipped.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.