Skip to content

Commit 3908c6c

Browse files
authored
Merge pull request PrestaShop#77 from PrestaShop/dev
Release v2.6.1
2 parents d4ef6d7 + 0281b9c commit 3908c6c

File tree

8 files changed

+36
-14
lines changed

8 files changed

+36
-14
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "04:00"
8+
open-pull-requests-limit: 10
9+
target-branch: dev
10+
- package-ecosystem: composer
11+
directory: "/"
12+
schedule:
13+
interval: daily
14+
time: "04:00"
15+
open-pull-requests-limit: 10
16+
target-branch: dev

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# E-mail subscription form
22

3+
[![Build Status](https://travis-ci.com/PrestaShop/ps_emailsubscription.svg?branch=master)](https://travis-ci.com/PrestaShop/ps_emailsubscription)
4+
[![Latest Stable Version](https://poser.pugx.org/PrestaShop/ps_emailsubscription/v)](//packagist.org/packages/PrestaShop/ps_emailsubscription)
5+
[![Total Downloads](https://poser.pugx.org/PrestaShop/ps_emailsubscription/downloads)](//packagist.org/packages/PrestaShop/ps_emailsubscription)
6+
[![GitHub license](https://img.shields.io/github/license/PrestaShop/ps_emailsubscription)](https://github.com/PrestaShop/ps_emailsubscription/LICENSE.md)
7+
38
## About
49

5-
Adds a block for newsletter subscription.
10+
Keep in touch with your customers the way you want, add a form to the homepage of your store and allow all the curious to subscribe to your newsletter.
611

712
## Multistore compatibility
813

config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<module>
33
<name>ps_emailsubscription</name>
44
<displayName><![CDATA[E-mail subscription form]]></displayName>
5-
<version><![CDATA[2.6.0]]></version>
5+
<version><![CDATA[2.6.1]]></version>
66
<description><![CDATA[Adds a block for newsletter subscription.]]></description>
77
<author><![CDATA[PrestaShop]]></author>
88
<confirmUninstall><![CDATA[Are you sure that you want to delete all of your contacts?]]></confirmUninstall>

logo.png

-71 Bytes
Loading

ps_emailsubscription.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ public function __construct(EntityManager $entity_manager)
6464
parent::__construct();
6565

6666
$this->displayName = $this->trans('Newsletter subscription', array(), 'Modules.Emailsubscription.Admin');
67-
$this->description = $this->trans('Adds a form for newsletter subscription.', array(), 'Modules.Emailsubscription.Admin');
67+
$this->description = $this->trans('Keep in touch with your customers the way you want, add a form to the homepage of your store and allow all the curious to subscribe to your newsletter.', array(), 'Modules.Emailsubscription.Admin');
6868
$this->confirmUninstall = $this->trans('Are you sure that you want to delete all of your contacts?', array(), 'Modules.Emailsubscription.Admin');
6969
$this->ps_versions_compliancy = array('min' => '1.7.1.0', 'max' => _PS_VERSION_);
7070

7171
$this->entity_manager = $entity_manager;
7272

73-
$this->version = '2.6.0';
73+
$this->version = '2.6.1';
7474
$this->author = 'PrestaShop';
7575
$this->error = false;
7676
$this->valid = false;
@@ -977,7 +977,9 @@ public function hookAdditionalCustomerFormFields($params)
977977
array(
978978
'[1]' => '<br>',
979979
'[2]' => '<em>',
980-
'%conditions%' => Configuration::get('NW_CONDITIONS', $this->context->language->id),
980+
'%conditions%' => Tools::htmlentitiesUTF8(
981+
Configuration::get('NW_CONDITIONS', $this->context->language->id)
982+
),
981983
'[/2]' => '</em>',
982984
),
983985
'Modules.Emailsubscription.Shop'
@@ -1119,7 +1121,7 @@ public function renderExportForm()
11191121
'hint' => $this->trans('Customers can subscribe to your newsletter when registering, or by entering their email in the newsletter form.', array(), 'Modules.Emailsubscription.Admin'),
11201122
'name' => 'SUSCRIBERS',
11211123
'required' => false,
1122-
'default_value' => (int) $this->context->country->id,
1124+
'default_value' => 1,
11231125
'options' => array(
11241126
'query' => array(
11251127
array('id' => 0, 'name' => $this->trans('All subscribers', array(), 'Modules.Emailsubscription.Admin')),
@@ -1138,7 +1140,7 @@ public function renderExportForm()
11381140
'hint' => $this->trans('Partner offers subscribers have agreed to receive your partners\' offers.', array(), 'Modules.Emailsubscription.Admin'),
11391141
'name' => 'OPTIN',
11401142
'required' => false,
1141-
'default_value' => (int) $this->context->country->id,
1143+
'default_value' => 1,
11421144
'options' => array(
11431145
'query' => array(
11441146
array('id' => 0, 'name' => $this->trans('All customers', array(), 'Modules.Emailsubscription.Admin')),
@@ -1169,7 +1171,6 @@ public function renderExportForm()
11691171
$lang = new Language((int) Configuration::get('PS_LANG_DEFAULT'));
11701172
$helper->default_form_language = $lang->id;
11711173
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
1172-
$helper->id = (int) Tools::getValue('id_carrier');
11731174
$helper->identifier = $this->identifier;
11741175
$helper->submit_action = 'btnSubmit';
11751176
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;
@@ -1444,7 +1445,7 @@ public function hookActionExportGDPRData($customer)
14441445
{
14451446
if (!Tools::isEmpty($customer['email']) && Validate::isEmail($customer['email'])) {
14461447
$sql = 'SELECT * FROM ' . _DB_PREFIX_ . "emailsubscription WHERE email = '" . pSQL($customer['email']) . "'";
1447-
if ($res = Db::getInstance()->ExecuteS($sql)) {
1448+
if ($res = Db::getInstance()->executeS($sql)) {
14481449
return json_encode($res);
14491450
}
14501451

views/templates/front/subscription_execution.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</p>
3333

3434
{if $variables.conditions}
35-
<p>{$variables.conditions nofilter}</p>
35+
<p>{$variables.conditions}</p>
3636
{/if}
3737

3838
{/block}

views/templates/hook/ps_emailsubscription-column.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<p class="notification {if $nw_error}notification-error{else}notification-success{/if}">{$msg}</p>
3030
{/if}
3131
<form action="{$urls.current_url}#blockEmailSubscription_{$hookName}" method="post">
32-
<input type="text" name="email" value="{$value}" placeholder="{l s='Your e-mail' d='Modules.Emailsubscription.Shop'}" />
32+
<input type="email" name="email" value="{$value}" placeholder="{l s='Your e-mail' d='Modules.Emailsubscription.Shop'}" required />
3333
{if $conditions}
34-
<p>{$conditions nofilter}</p>
34+
<p>{$conditions}</p>
3535
{/if}
3636
{hook h='displayNewsletterRegistration'}
3737
<input type="hidden" name="blockHookName" value="{$hookName}" />

views/templates/hook/ps_emailsubscription.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<p class="notification {if $nw_error}notification-error{else}notification-success{/if}">{$msg}</p>
3030
{/if}
3131
<form action="{$urls.current_url}#blockEmailSubscription_{$hookName}" method="post">
32-
<input type="text" name="email" value="{$value}" placeholder="{l s='Your e-mail' d='Modules.Emailsubscription.Shop'}" />
32+
<input type="email" name="email" value="{$value}" placeholder="{l s='Your e-mail' d='Modules.Emailsubscription.Shop'}" required />
3333
{if $conditions}
34-
<p>{$conditions nofilter}</p>
34+
<p>{$conditions}</p>
3535
{/if}
3636
{hook h='displayNewsletterRegistration'}
3737
<input type="hidden" value="{$hookName}" name="blockHookName" />

0 commit comments

Comments
 (0)