Jump to content

function Mail :: Send prestashop date in subject

Recommended Posts

I am trying to include in the subject of the email that admin receives when there is a new order the day of the week that is at that moment but I do not get it to work. For example I want to receive as admin in the subject this:
  Oscar Cuenca, New order: # 4524 - YKSUCKDON - Monday
This is because I am using a CRM and I am interested in the email I receive to set the current day of the week in which the email was created.
What I do is this:
I add the variables:

$fecha = array("sunday","monday","twesday","Wednesday","Thursday","Friday","saturday");
		$dia = $fecha[date("w")];

In the file mailalerts.php, line approx 254

public function hookActionValidateOrder($params)
		if (!$this->merchant_order || empty($this->merchant_mails))

		// Getting differents vars
		$context = Context::getContext();
		$id_lang = (int)$context->language->id;
		$id_shop = (int)$context->shop->id;
		$currency = $params['currency'];
		$order = $params['order'];
		$fecha = array("sunday","monday","Tuesday","miercoles","Thursday","Friday","saturday");
		$dia = $fecha[date("w")];
		$customer = $params['customer'];
		$configuration = Configuration::getM........

Once this is done, in this same file, line 466 in the Mail :: Send function

					sprintf(Mail::l($customer->lastname.', '.'New order : #%d - %s'.', '.$dia, $mail_id_lang), $order->id, $order->reference),

This done, it does not cause any effect. I still receiving the same subject:
  Oscar Cuenca, New order: # 4524 - YKSUCKDON
Without the day of the week.
If someone can help me, I'll thank you-

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

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