Jump to content
ietax

Disable mail for CREDIT SLIP.

Recommended Posts

Hi, when i create a credit slip PS send mail to customer.

How can I disable this? Thanks.

Share this post


Link to post
Share on other sites

I think you can do that in (backoffice obviously):

 

Orders - statusses, then go to the item for credit slip en disable the email message.

Share this post


Link to post
Share on other sites

Search for refund, I guess that will be the correct translation (from Dutch to English).

Share this post


Link to post
Share on other sites

Yes, i disabled mail but it send to customer. I think there is not a status config..

Share this post


Link to post
Share on other sites

A bit late, but if others are searching, here's the solution.
In controllers/admin/ find the file AdminOrdersController.php
 
On line 956 (depending on version - else search for 'credit_slip') remove this piece of code:

@Mail::Send(
	(int)$order->id_lang,
	'credit_slip',
	Mail::l('New credit slip regarding your order', (int)$order->id_lang),
	$params,
	$customer->email,
	$customer->firstname.' '.$customer->lastname,
	null,
        null,
	null,
        null,
	_PS_MAIL_DIR_,
	true,
	(int)$order->id_shop
);
Edited by Christiaan_01 (see edit history)

Share this post


Link to post
Share on other sites

 

A bit late, but if others are searching, here's the solution.

In controllers/admin/ find the file AdminOrdersController.php

 

On line 956 (depending on version - else search for 'credit_slip') remove this piece of code:

@Mail::Send(
	(int)$order->id_lang,
	'credit_slip',
	Mail::l('New credit slip regarding your order', (int)$order->id_lang),
	$params,
	$customer->email,
	$customer->firstname.' '.$customer->lastname,
	null,
        null,
	null,
        null,
	_PS_MAIL_DIR_,
	true,
	(int)$order->id_shop
);

 

Thanks! Exactly what I was looking for.

Share this post


Link to post
Share on other sites

Thanks, also what I was looking for. To adjust it the 'clean' way you can override the Mail class:

class Mail extends MailCore
{
     public static function Send($id_lang, $template, $subject, $template_vars, $to,
        $to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
        $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null, $reply_to = null)
    {
         // Don't send an email a credit slip is created (not configurable in backoffice)
         if ($template == 'credit_slip') {
             return true;
         }
         
         return parent::Send($id_lang, $template, $subject, $template_vars, $to, $to_name, $from, $from_name, $file_attachment, $mode_smtp, $template_path, $die, $id_shop, $bcc, $reply_to);
     }
}
  • Like 1

Share this post


Link to post
Share on other sites

I Like to do the same thing. Disable the sendig of this mail. But when I take the first option. I still see in the mail-list a mail is send.

Wich file do I open to change it for the second option?

Share this post


Link to post
Share on other sites

Overriding of MailCore class is not the best option.

It's better to use hooks. You can use standard actionEmailSendBefore hook to disable email notification.

If you are interested, we have a paid module for disabling emails.

Share this post


Link to post
Share on other sites
On 5/16/2019 at 10:24 PM, MageryThemes said:

Overriding of MailCore class is not the best option.

It's better to use hooks. You can use standard actionEmailSendBefore hook to disable email notification.

If you are interested, we have a paid module for disabling emails.

on 1.6.x version i think that actionEmailSendBefore  is not implemented yet is why mail override is necessary

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More