Skip to content

Commit

Permalink
Merge pull request #79 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Release 2.2.2
  • Loading branch information
PierreRambaud authored Mar 16, 2021
2 parents 2e52395 + ca551db commit 7ced3b6
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 55 deletions.
5 changes: 4 additions & 1 deletion MailAlert.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ public static function sendCustomerAlert($id_product, $id_product_attribute)
}

$iso = Language::getIsoById($id_lang);
$locale = Language::getLocaleByIso($iso);

$translator = Context::getContext()->getTranslatorFromLocale($locale);

if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.txt') &&
file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.html')) {
Expand All @@ -205,7 +208,7 @@ public static function sendCustomerAlert($id_product, $id_product_attribute)
Mail::Send(
$id_lang,
'customer_qty',
Mail::l('Product available', $id_lang),
$translator->trans('Product available', array(), 'Emails.Subject', $locale),
$template_vars,
(string) $customer_email,
null,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## About

Sends e-mail notifications to customers and merchants regarding stock and order modifications.
Make your everyday life easier, handle mail alerts about stock and orders, addressed to you as well as your customers.

## Multistore compatibility

Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_emailalerts</name>
<displayName><![CDATA[Mail alerts]]></displayName>
<version><![CDATA[2.2.1]]></version>
<version><![CDATA[2.2.2]]></version>
<description><![CDATA[Sends e-mail notifications to customers and merchants regarding stock and order modifications.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function processRemove()
$context = Context::getContext();
if (MailAlert::deleteAlert(
(int) $context->customer->id,
(int) $context->customer->email,
(string) $context->customer->email,
(int) $product->id,
(int) $this->id_product_attribute,
(int) $context->shop->id
Expand Down
Binary file modified logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 78 additions & 45 deletions ps_emailalerts.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions views/templates/front/mailalerts-account.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{extends file='customer/page.tpl'}

{block name='page_title'}
{l s='My alerts' d='Modules.Mailalerts.Shop'}
{l s='My alerts' d='Modules.Emailalerts.Shop'}
{/block}

{block name='page_content'}
Expand All @@ -36,6 +36,6 @@
{/foreach}
</ul>
{else}
<p class="alert alert-warning">{l s='No mail alerts yet.' d='Modules.Mailalerts.Shop'}</p>
<p class="alert alert-warning">{l s='No mail alerts yet.' d='Modules.Emailalerts.Shop'}</p>
{/if}
{/block}
2 changes: 1 addition & 1 deletion views/templates/hook/my-account-footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
*}

<li>
<a href="{url entity='module' name='ps_emailalerts' controller='account'}">{l s='My alerts' d='Modules.Mailalerts.Shop'}</a>
<a href="{url entity='module' name='ps_emailalerts' controller='account'}">{l s='My alerts' d='Modules.Emailalerts.Shop'}</a>
</li>
2 changes: 1 addition & 1 deletion views/templates/hook/my-account.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
*}

<li>
<a href="{url entity='module' name='ps_emailalerts' controller='account'}">{l s='My alerts' d='Modules.Mailalerts.Shop'}</a>
<a href="{url entity='module' name='ps_emailalerts' controller='account'}">{l s='My alerts' d='Modules.Emailalerts.Shop'}</a>
</li>
4 changes: 2 additions & 2 deletions views/templates/hook/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
<form>
<div class="js-mailalert" style="text-align:center;" data-url="{url entity='module' name='ps_emailalerts' controller='actions' params=['process' => 'add']}">
{if isset($email) AND $email}
<input class="form-control" type="email" placeholder="{l s='[email protected]' d='Modules.Mailalerts.Shop'}"/><br />
<input class="form-control" type="email" placeholder="{l s='[email protected]' d='Modules.Emailalerts.Shop'}"/><br />
{/if}
{if isset($id_module)}
{hook h='displayGDPRConsent' id_module=$id_module}
{/if}
<input type="hidden" value="{$id_product}"/>
<input type="hidden" value="{$id_product_attribute}"/>
<button class="btn btn-primary" type="submit" rel="nofollow" onclick="return addNotification();">{l s='Notify me when available' d='Modules.Mailalerts.Shop'}</button>
<button class="btn btn-primary" type="submit" rel="nofollow" onclick="return addNotification();">{l s='Notify me when available' d='Modules.Emailalerts.Shop'}</button>
<span style="display:none;padding:5px"></span>
</div>
</form>
Expand Down

0 comments on commit 7ced3b6

Please sign in to comment.