Jump to content

Add Name field to Newsletter subscribe


 Share

Recommended Posts

Does anyone know how to add a field to the newsletter subscribe box so the customer puts their first (and maybe last name) in? I like to personalize email newsletters, but only get the person's email address, no other information.

Thanks in advance!

 

It's for you :)

 

<-- For prestashop < 1.5

 

<-- For prestashop 1.5 and +

 

To unsubscribe, only email is required.

 

Eolia

 

PS:Remember to reinitialise the module and refresh your cache and empty your tools / smarty / compile directory to see the change

Edited by Eolia (see edit history)

Share this post


Link to post
Share on other sites

Thanks, Eolia, but for some reason, when I uploaded the module through BO, there was no change in my newsletter subscription box, but my menu got completely messed up with error messages instead of links, and a "banner" div on the page, which I had thought I had hidden, is now generating a Smarty error message - any idea why this happened? Website is http://thestitchersmuse.com - though I will be changing all back later today (I had backed up the site before changing the newsletter block). Also, the category selection on the index page leads to a 404 error.

I have set BO to Force Compile and no Cache - no difference...

Share this post


Link to post
Share on other sites

Please suppress lines 30&31 in blocknewsletter.php

@ini_set('display_errors', 'on');
error_reporting(E_ALL);

The attached file has been modified

 

(it's because i was in debug mode..., sorry)

But this means that your theme have some errors (not important there are only notices).

 

In the blocknewsletter configure options, choose 'open confirmation in a new window to see the result)

Share this post


Link to post
Share on other sites

  • 4 months later...
  • 2 months later...

What errors ? Your newsletter subscription

 

 

 

on www.bestcomputerservice.ro/unsubscribe.php

 

Warning: Cannot modify header information - headers already sent by (output started at /home1/subulica/public_html/modules/newsletteradmin/functions.php:118) in /home1/subulica/public_html/unsubscribe.php on line 52

Invalid e-mail address.

 

Warning: Cannot modify header information - headers already sent by (output started at /home1/subulica/public_html/modules/newsletteradmin/functions.php:118) in /home1/subulica/public_html/classes/Cookie.php on line 302

 

Edited by subulica (see edit history)

Share this post


Link to post
Share on other sites

  • 2 months later...
  • 3 weeks later...

Please suppress lines 30&31 in blocknewsletter.php

@ini_set('display_errors', 'on');
error_reporting(E_ALL);

The attached file has been modified

 

(it's because i was in debug mode..., sorry)

But this means that your theme have some errors (not important there are only notices).

 

In the blocknewsletter configure options, choose 'open confirmation in a new window to see the result)

 

 

Hello Eolia,

 

I'm trying to use your newsletter module- extended version, but the newsletter box is unchanged. When i enter a new email adress It give's the error "Firstname or Lastname can't be empty" but there are no avaible field for the First&Last Name..

 

Thank you for your support !

Share this post


Link to post
Share on other sites

Hello Eolia,

 

I'm trying to use your newsletter module- extended version, but the newsletter box is unchanged. When i enter a new email adress It give's the error "Firstname or Lastname can't be empty" but there are no avaible field for the First&Last Name..

 

Thank you for your support !

refresh yours tpl (in BO options) or delete by ftp all files in / tools/smarty/compile and look :)

Share this post


Link to post
Share on other sites

Hi Eolia,

 

I am using PSNewsLetter 2.9 on PS 1.5.1.0. I added an unsubscribe link to the bottom of my email. Unfortunately, when I tried to click on the unsubscribe link in the email, it throws an error:-

 

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionu/public_html/staging/modules/newsletteradmin/functions.php:116) in /home/fashionu/public_html/staging/classes/controller/FrontController.php on line 772

 

However, it was able to unsubscribe me successfully. I'm just not sure how I can prevent the above error from showing up... could you advise, please? Thanks in advance.

Share this post


Link to post
Share on other sites

Hi Eolia,

 

I am using PSNewsLetter 2.9 on PS 1.5.1.0. I added an unsubscribe link to the bottom of my email. Unfortunately, when I tried to click on the unsubscribe link in the email, it throws an error:-

 

Warning: Cannot modify header information - headers already sent by (output started at /home/fashionu/public_html/staging/modules/newsletteradmin/functions.php:116) in /home/fashionu/public_html/staging/classes/controller/FrontController.php on line 772

 

However, it was able to unsubscribe me successfully. I'm just not sure how I can prevent the above error from showing up... could you advise, please? Thanks in advance.

 

Please delete the " ?> " at the end of the file (/modules/newsletteradmin/function.php)

  • Like 1

Share this post


Link to post
Share on other sites

Hi Eolia,

 

Thanks - your solution works. :) Kudos to you as well for sharing such a great module with the PS community. Keep up the good work!

 

Btw - just one more question - could you advise how do I change the background color of the unsubscribe message? I tried editing the modules/newsletteradmin/scripts/files/unsubscribe.php for the following lines, but it doesn't seem to take any effect even after I cleared my cache. Is there anywhere else I need to change? Please advise.

 

echo "<div style='none'><br/>";

echo "<h1>  ".trans('Your Newsletter Subscription')."</h1><p> </p>";

Edited by elenichee (see edit history)

Share this post


Link to post
Share on other sites

refresh yours tpl (in BO options) or delete by ftp all files in / tools/smarty/compile and look :)

 

I dont have the cache in tools, I have it in /cache/smarty/cache & cache/smarty/compile

I did that, i even uninstall the newsletter module, then reinstall it, but the problem still exist.

Now i'm thinking reinstalling the whole prestashop.. :(

Share this post


Link to post
Share on other sites

  • 4 weeks later...
  • 1 month later...

Uploaded, installed, deleted all the smarty files, but there is no the new field.

Downloaded the 1.5 from your link, but it says ver:1.4 I think this is the module, and not the ps ver. number.

Any tipp?

Share this post


Link to post
Share on other sites

Teher was an old blocknewsletter.tpl file n my Themes/mytheme/modules/blocknewsletter folder.

Changed it with your's and it is working now.

Thanks for info :)

For all, delete all references before install the new block, please.

Share this post


Link to post
Share on other sites

  • 2 months later...

Hi! For me the module don´t add users in BO.

There is the Subscription successful message, but with no action.

 

I think your database was not updated... (names and surnames are missing) please re-initialize your module.

Share this post


Link to post
Share on other sites

Eolia,

Is writing on the base but the warnings do not appear.

 

This is the code:

 

<div id="newsletter_block_left" class="block">

<h4>{l s='Newsletter' mod='blocknewsletter'}</h4>

<div class="block_content">

{if isset($msg) && $msg}

<p class="{if $nw_error}warning_inline{else}success_inline{/if}">{$msg}</p>

{/if}

<form action="{$link->getPageLink('index')}" method="post">

<p>

{* @todo use jquery (focusin, focusout) instead of onblur and onfocus *}

<p><input type="text" name="email" size="18" value="{if isset($value) && $value}{$value}{else}{l s='your e-mail' mod='blocknewsletter'}{/if}" onfocus="javascript:if(this.value=='{l s='your e-mail' mod='blocknewsletter'}')this.value='';" onblur="javascript:if(this.value=='')this.value='{l s='your firstname' mod='blocknewsletter'}';" /></p>

<p><input type="text" name="firstname" size="18" value="{if isset($value) && $value}{$value}{else}{l s='your firstname' mod='blocknewsletter'}{/if}" onfocus="javascript:if(this.value=='{l s='your firstname' mod='blocknewsletter'}')this.value='';" onblur="javascript:if(this.value=='')this.value='{l s='your firstname' mod='blocknewsletter'}';" /></p>

<p><input type="text" name="lastname" size="18" value="{if isset($value) && $value}{$value}{else}{l s='your lastname' mod='blocknewsletter'}{/if}" onfocus="javascript:if(this.value=='{l s='your lastname' mod='blocknewsletter'}')this.value='';" onblur="javascript:if(this.value=='')this.value='{l s='your lastname' mod='blocknewsletter'}';" /></p>

<!--<select name="action">

<option value="0"{if isset($action) && $action == 0} selected="selected"{/if}>{l s='Subscribe' mod='blocknewsletter'}</option>

<option value="1"{if isset($action) && $action == 1} selected="selected"{/if}>{l s='Unsubscribe' mod='blocknewsletter'}</option>

</select>-->

<input type="submit" value="ok" class="button_mini" name="submitNewsletter" />

<input type="hidden" name="action" value="0" />

</p>

</form>

</div>

</div>

<!-- /Block Newsletter module-->

Share this post


Link to post
Share on other sites

Eolia,

Is writing on the base but the warnings do not appear.

 

The warning is only for the email adress (if you want i can modify the code to add warnings on firstname and lastname)

Share this post


Link to post
Share on other sites

Thank you I would not have done as

I think for a newsletter that is important is the choice to subescribe/unsubscribe, whether it is a man / woman / company, country / city to better target your newsletter module is also very good.

Also if customer is logged or not

This module is it complements your module?

Share this post


Link to post
Share on other sites

Thank you I would not have done as

I think for a newsletter that is important is the choice to subescribe/unsubscribe, whether it is a man / woman / company, country / city to better target your newsletter module is also very good.

Also if customer is logged or not

This module is it complements your module?

 

yes! (bis :) )

You can change the code if you want others required files

Share this post


Link to post
Share on other sites

  • 1 month later...

Hi!

This modul is awesome. Exactly what I need :) It works perfect until I install ssl certificate.

 

Now every e-mail in message have incorrect link.

 

I have presta 1.5.4.1 and I don't have set ssl domain in seo and url tab (I din't now why. My admin have instal ssl for me).

 

Now every e-mail have incorrect link as:

 

(for unsubsribe:)

https:///?SID=Yml1cm...ption&id_lang=1

 

It should be:

https://s-shop.pl/?S...ption&id_lang=1

 

The question is... How to change links? I want to send newsletter with no ssl links like this:

 

http://s-shop.pl/?SI...ption&id_lang=1

 

An I have one more question... Is this module use original Prestashop Newsletter block for subscribes and unsubsribes clients?

 

I have communicate on newsletter tab like this:

 

Newsletter Block Subscribers (The BlockNewsletter is not installed or no subscriber)

 

But I have installed my original newsletter block and have some subscribers...

Edited by Dzidzia_2 (see edit history)

Share this post


Link to post
Share on other sites

Hi!

This modul is awesome. Exactly what I need :) It works perfect until I install ssl certificate.

 

Now every e-mail in message have incorrect link.

 

I have presta 1.5.4.1 and I don't have set ssl domain in seo and url tab (I din't now why. My admin have instal ssl for me).

 

Now every e-mail have incorrect link as:

 

(for unsubsribe:)

https:///?SID=Yml1cm...ption&id_lang=1

 

It should be:

https://s-shop.pl/?S...ption&id_lang=1

 

The question is... How to change links? I want to send newsletter with no ssl links like this:

 

http://s-shop.pl/?SI...ption&id_lang=1

 

An I have one more question... Is this module use original Prestashop Newsletter block for subscribes and unsubsribes clients?

 

I have communicate on newsletter tab like this:

 

Newsletter Block Subscribers (The BlockNewsletter is not installed or no subscriber)

 

But I have installed my original newsletter block and have some subscribers...

LOL...

This is normal if you have not filled the fields "SSL address"...

Share this post


Link to post
Share on other sites

Well.. I know it. But I don't wont to sent newsletter with links started with https:// I want to send links with only http://

 

I know that I should change seo and url tab but this is not what I am looking for :)

Share this post


Link to post
Share on other sites

ok,

try to modify this function in newsletteradmin/controllers/admin/AdminNewsletter.php, line 1649:

 

replace:

private function getShopUrl()
{
 $ShopUrl = Db::getInstance()->getRow("
 SELECT
  domain,
  domain_ssl,
	    physical_uri,
	    virtual_uri
 FROM
  `"._DB_PREFIX_."shop_url`
    WHERE  id_shop = ".$this->context->shop->id);
 if(Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS'])&& strtolower($_SERVER['HTTPS']) != 'off'))
  return 'https://'.$ShopUrl['domain_ssl'].$ShopUrl['physical_uri'].$ShopUrl['virtual_uri'];
 else
  return 'http://'.$ShopUrl['domain'].$ShopUrl['physical_uri'].$ShopUrl['virtual_uri'];
}

by:

private function getShopUrl()
{
 $ShopUrl = Db::getInstance()->getRow("
 SELECT
  domain,
	    physical_uri,
	    virtual_uri
 FROM
  `"._DB_PREFIX_."shop_url`
    WHERE  id_shop = ".$this->context->shop->id);

 return 'http://'.$ShopUrl['domain'].$ShopUrl['physical_uri'].$ShopUrl['virtual_uri'];
}

Share this post


Link to post
Share on other sites

ok,

try to modify this function in newsletteradmin/controllers/admin/AdminNewsletter.php, line 1649:

 

replace:

private function getShopUrl()
{
 $ShopUrl = Db::getInstance()->getRow("
 SELECT
  domain,
  domain_ssl,
		physical_uri,
		virtual_uri
 FROM
  `"._DB_PREFIX_."shop_url`
	WHERE  id_shop = ".$this->context->shop->id);
 if(Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS'])&& strtolower($_SERVER['HTTPS']) != 'off'))
  return 'https://'.$ShopUrl['domain_ssl'].$ShopUrl['physical_uri'].$ShopUrl['virtual_uri'];
 else
  return 'http://'.$ShopUrl['domain'].$ShopUrl['physical_uri'].$ShopUrl['virtual_uri'];
}

by:

private function getShopUrl()
{
 $ShopUrl = Db::getInstance()->getRow("
 SELECT
  domain,
		physical_uri,
		virtual_uri
 FROM
  `"._DB_PREFIX_."shop_url`
	WHERE  id_shop = ".$this->context->shop->id);

 return 'http://'.$ShopUrl['domain'].$ShopUrl['physical_uri'].$ShopUrl['virtual_uri'];
}

 

Working perfect!

 

Thanks for fast reply :)

 

Now I am looking for newsletter templates :)

 

Thanks once more!

Share this post


Link to post
Share on other sites

  • 3 weeks later...

i have more than 10000+ imported subscribers from one of my store to another, when i select all of them and start sent my newsletter, i got a "server error" page with error 500

this is quite normal ... Your time_limit values are not enough in your  php.ini.
Use cron task for 5000  or higher shipments

Share this post


Link to post
Share on other sites

  • 2 years later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

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