[+] BO : CB-30 - Customer receive an email when a voucher is created in BO
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8055 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -169,7 +169,40 @@ class AdminDiscounts extends AdminTab
|
||||
if (!$object->add(true, false, $categories))
|
||||
$this->_errors[] = Tools::displayError('An error occurred while creating object.').' <b>'.$this->table.'</b>';
|
||||
elseif (($_POST[$this->identifier] = $object->id /* voluntary */) AND $this->postImage($object->id) AND $this->_redirect)
|
||||
Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token);
|
||||
{
|
||||
if ($customer = new Customer($object->id_customer) AND Validate::isLoadedObject($customer))
|
||||
{
|
||||
if (Validate::isEmail($customer->email))
|
||||
{
|
||||
$data = array(
|
||||
'{firstname}' => $customer->firstname,
|
||||
'{lastname}' => $customer->lastname,
|
||||
'{email}' => $customer->email,
|
||||
'{voucher_num}' => $object->name);
|
||||
|
||||
@Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'voucher_new', Mail::l('New voucher'), $data, $customer->email, $customer->firstname.' '.$customer->lastname);
|
||||
}
|
||||
}
|
||||
elseif ($group = new Group($object->id_group) AND Validate::isLoadedObject($group))
|
||||
{
|
||||
$customer = null;
|
||||
$customers = $group->getCustomers();
|
||||
|
||||
if ($customers)
|
||||
foreach ($customers as $customer)
|
||||
{
|
||||
$data = array(
|
||||
'{firstname}' => $customer['firstname'],
|
||||
'{lastname}' => $customer['lastname'],
|
||||
'{email}' => $customer['email'],
|
||||
'{voucher_num}' => $object->name);
|
||||
|
||||
@Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'voucher_new', Mail::l('New voucher'), $data, $customer['email'], $customer['firstname'].' '.$customer['lastname']);
|
||||
}
|
||||
}
|
||||
|
||||
Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token);
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('You do not have permission to add here.');
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Message from {shop_name}</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family:Verdana,sans-serif; font-size:11px; color:#374953; width: 550px;">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">Hi <strong style="color:#DB3484;">{firstname} {lastname}</strong>,</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
This is to inform you about the creation of a voucher.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Here is the code of your voucher : <b>{voucher_num}</b>.<br />
|
||||
Simply copy/paste this code during the payment process for your next order.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size:10px; border-top: 1px solid #D9DADE;">
|
||||
<a href="{shop_url}" style="color:#DB3484; font-weight:bold; text-decoration:none;">{shop_name}</a> powered with <a href="http://www.prestashop.com/" style="text-decoration:none; color:#374953;">PrestaShop™</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
Hi {firstname} {lastname},
|
||||
|
||||
This is to inform you about the creation of a voucher.
|
||||
|
||||
Here is the code of your voucher : {voucher_num}.
|
||||
|
||||
Simply copy/paste this code during the payment process for your next order.
|
||||
|
||||
Thank you for shopping at {shop_name}.
|
||||
|
||||
{shop_name} - {shop_url}
|
||||
|
||||
|
||||
{shop_url} powered by PrestaShop™
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Message from {shop_name}</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family:Verdana,sans-serif; font-size:11px; color:#374953; width: 550px;">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">Hi <strong style="color:#DB3484;">{firstname} {lastname}</strong>,</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
This is to inform you about the creation of a voucher.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Here is the code of your voucher : <b>{voucher_num}</b>.<br />
|
||||
Simply copy/paste this code during the payment process for your next order.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size:10px; border-top: 1px solid #D9DADE;">
|
||||
<a href="{shop_url}" style="color:#DB3484; font-weight:bold; text-decoration:none;">{shop_name}</a> powered with <a href="http://www.prestashop.com/" style="text-decoration:none; color:#374953;">PrestaShop™</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
Hi {firstname} {lastname},
|
||||
|
||||
This is to inform you about the creation of a voucher.
|
||||
|
||||
Here is the code of your voucher : {voucher_num}.
|
||||
|
||||
Simply copy/paste this code during the payment process for your next order.
|
||||
|
||||
Thank you for shopping at {shop_name}.
|
||||
|
||||
{shop_name} - {shop_url}
|
||||
|
||||
|
||||
{shop_url} powered by PrestaShop™
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Message from {shop_name}</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family:Verdana,sans-serif; font-size:11px; color:#374953; width: 550px;">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">Hi <strong style="color:#DB3484;">{firstname} {lastname}</strong>,</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
This is to inform you about the creation of a voucher.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Here is the code of your voucher : <b>{voucher_num}</b>.<br />
|
||||
Simply copy/paste this code during the payment process for your next order.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size:10px; border-top: 1px solid #D9DADE;">
|
||||
<a href="{shop_url}" style="color:#DB3484; font-weight:bold; text-decoration:none;">{shop_name}</a> powered with <a href="http://www.prestashop.com/" style="text-decoration:none; color:#374953;">PrestaShop™</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
Hi {firstname} {lastname},
|
||||
|
||||
This is to inform you about the creation of a voucher.
|
||||
|
||||
Here is the code of your voucher : {voucher_num}.
|
||||
|
||||
Simply copy/paste this code during the payment process for your next order.
|
||||
|
||||
Thank you for shopping at {shop_name}.
|
||||
|
||||
{shop_name} - {shop_url}
|
||||
|
||||
|
||||
{shop_url} powered by PrestaShop™
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Message de {shop_name}</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family:Verdana,sans-serif; font-size:11px; color:#374953; width: 550px;">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">Bonjour <strong style="color:#DB3484;">{firstname} {lastname}</strong>,</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Nous vous informons de la génération d'un bon de réduction.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Voici le numéro de votre bon de réduction : <b>{voucher_num}</b>.<br />
|
||||
Copiez-collez ce numéro dans le panier de votre prochain achat avant de régler la commande.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size:10px; border-top: 1px solid #D9DADE;">
|
||||
<a href="{shop_url}" style="color:#DB3484; font-weight:bold; text-decoration:none;">{shop_name}</a> réalisé avec <a href="http://www.prestashop.com/" style="text-decoration:none; color:#374953;">PrestaShop™</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
Bonjour {firstname} {lastname},
|
||||
|
||||
Nous vous informons de la génération d'un bon de réduction.
|
||||
|
||||
Voici le numéro de votre bon de réduction : {voucher_num}.
|
||||
Copiez-collez ce numéro dans le panier de votre prochain achat avant de régler la commande.
|
||||
|
||||
Merci et à bientôt sur {shop_name}.
|
||||
|
||||
{shop_name} - {shop_url}
|
||||
|
||||
|
||||
{shop_url} réalisé par PrestaShop™
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Message from {shop_name}</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family:Verdana,sans-serif; font-size:11px; color:#374953; width: 550px;">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">Hi <strong style="color:#DB3484;">{firstname} {lastname}</strong>,</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
This is to inform you about the creation of a voucher.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Here is the code of your voucher : <b>{voucher_num}</b>.<br />
|
||||
Simply copy/paste this code during the payment process for your next order.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size:10px; border-top: 1px solid #D9DADE;">
|
||||
<a href="{shop_url}" style="color:#DB3484; font-weight:bold; text-decoration:none;">{shop_name}</a> powered with <a href="http://www.prestashop.com/" style="text-decoration:none; color:#374953;">PrestaShop™</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
Hi {firstname} {lastname},
|
||||
|
||||
This is to inform you about the creation of a voucher.
|
||||
|
||||
Here is the code of your voucher : {voucher_num}.
|
||||
|
||||
Simply copy/paste this code during the payment process for your next order.
|
||||
|
||||
Thank you for shopping at {shop_name}.
|
||||
|
||||
{shop_name} - {shop_url}
|
||||
|
||||
|
||||
{shop_url} powered by PrestaShop™
|
||||
Reference in New Issue
Block a user