Jump to content
Oscar

function Mail :: Send prestashop date in subject

Recommended Posts

Hello
Prestashop 1.6.0.9
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))
			return;

		// 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

$mail_id_lang,
					'new_order',
					sprintf(Mail::l($customer->lastname.', '.'New order : #%d - %s'.', '.$dia, $mail_id_lang), $order->id, $order->reference),
					$template_vars,
					$merchant_mail,
					null,
					$customer->email,
					$configuration['PS_SHOP_NAME'],
					null,
					null,
					$dir_mail,
					null,
					$id_shop
				);

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