You are on page 1of 10

NEWSLETTER Module for Version 1.

5 and above by Eolia


(Update 6/10/2013)
Following several requests, here is a help for the installation and use of this module:

Installation: ( for those who do not have the latest auto-update version)
Download the module on the forum or here: Module newsletteradmin Version Prestashop >1.5
You can install it from the "Modules" tab in your BO ( Add a module from my computer ) or manually
transfer . The manual method is recommended in case you have problems with ftp rights (user wwwdata script different from your user login )
So , manual method :
Unzip it and copy it via ftp (passive mode, binary) in your "modules" directory.

Go to your "modules" tab, sub-heading Emailing.

Click " Install" and then you get here : Customers-> Send a newsletter

Copying and configuring your module then proceeds to give you different informations , files are
copied , the location of your internal translations

If you have errors (often a problem of copy rights ) , look good error messages and make copies
manually. See FAQ below.
Then clicking on the button " Go to the module ."
Note : You will get this warning if you are in multishop context and you do not have a pre- selected :

Once you have chosen store ( if you're on single shop this page is displayed directly ) you have this:

Use :
Start with a test:
Choose a subject . As it is pre-filled with the current date , allowed to like that, but you are free to
change it. Just avoid exotic characters that may not be readable in some messaging . The variables
which we will discuss below can be inserted into the subject (%TITRE% - %PRENOM% - %NOM%).
It continues ...
Write your message, you can import templates (created by yourself or downloaded over the web) in
/ js / tiny_mce / templates and then insert with built in editor button.
For the test to be interesting , subscribe to the newsletter, you will understand why .
Insert these variables to capture their usefulness in the mail: %CIVILITY%- %FIRSTNAME%%LASTNAME%- %MAIL% %LINK% - %SUB% - %UNSUB%
Here is an example for those who would not have understood :
% LINK %
Hello %CIVILITY% %FIRSTNAME% %LASTNAME%!
Your email %MAIL% was randomly selected to win 50% off this week, so do not hesitate!
% UNSUB
You can copy / paste this example in the editor, it's made for .
This will give you at the reception:
Click here to view this email in your browser
Hello Mr John DOE !
Your email pub@prestashop.com was drawn to win 50% off this week, so do not
hesitate!
unsubscribe
For those who want to customize the header and/or footer of the email you can edit two files in the
directory newsletteradmin/mails/en/ : newsletter.txt and newsletter.html .
To add the logo of your store , for example , insert this line:
<td align="left"><a title="{shop_name}" href="{shop_url}"><img
src="{shop_logo}" alt="{shop_name}" /></a></td>

style="border:

none;"

THE ONLY IMPORTANT THING IS NOT DELETE THE VARIABLE {message } else your email will be
empty

For info: txt file used for sending in text mode. This module uses a class that allows for proper
rendering in pure text mode (plain text) maintaining the general appearance of the email and to view
links.
Now you define your mailing settings.
Click here:

And enter your shipping parameters:

Set the number of items per minute ( some hosts bridle to 400 emails/hour ) this value can be
increased if you use the SMTP method rather than phpmail (). Just make tests , depending on your
accommodation and servers.
I know who turn to 20 000 subscribers with this module. The only constraint is the initialization of
the starting list. Indeed, the script must select all the email addresses , verify their validity and
remove any duplicates. If you have 20,000 addresses to process your max_execution_time may be
exceeded . In this case create groups of 1 to 2000 customers and send them one after the other or
use the cron tasks is ideal for mass mailings .
Choose the name of the sender, reply address if you wish and the name of the mailing list. If you
leave these fields blank (first and two ) , these will be filled in by default to avoid being blacklisted for
spam.
Select the recipient ( as you test , you select "Test sending to an address " and you put yours) .
Choose whether or not to save your campaigns (useful if you use the link %LINK% in the email that
enables those who receive it in text mode, to see in their browser )
Choose to save your email as template. This will allow you to reuse .
Send your emails and watch the progress . As there is one, it is quite fast.
In the first email you a preview of the email , then a progress bar until the last email .

You may be a warning:

If you sent two newsletters on without changing the subject, the backup ( which takes the name of
the subject ) will overwrite the previous one.
Do not close the browser window (works by refreshing the page) and prevent your computer from
going to sleep as long as you 're not 100 % of shipments. If you need to work in your BO, just open a
second tab in your browser (or a second instance).
If you need to send more than 2000 messages , use the cron jobs that are made for it. You will report
by mail by sending end and history will be available in the logs .
The result is displayed with SUCCESS or FAIL . Success does not mean that the recipient has received,
but that email is gone. After , where it will land , nobody knows ...
Once the newsletter sent you here back to the main page of the module where you can manage your
newsletters sent , your logs and templates.
To see these tabs click the green arrow or the title :

A new section has emerged that will allow you to follow the opening of mail rate ( not 100% reliable
because it does not need scripts or image display are blocked by users or courier ) and the history of
your campaigns (the last 10 , we will not clutter the server with unnecessary stuff) .

The Drop results option clears statistics, if tests or error.

You can also import a list of emails (with Full Name if you wish) from txt or csv format. Exemple.csv is
a file provided in the module directory to allow you to take the test, what you do now : - > Choose
File -> Save. A new window opens with different informations and you can control the imported list.
If a syntax error appears the script stops, so, control your file. The email format is 3 columns
Email;Name;First Name
If you have no first / last name not put a ";" One line by email , the ";" are useless
You can import a list temporarily (next import instead) or want to keep it for later. In this case,
choose " Record and Save " , give it a name for future reference.
You have just enough time to see that everything went well (3 sec ) and you 're back on your main
page. A figure has changed, that the last line of choices :

Email list imported from csv file: (3)

Imported CSV Groups (0) :

So you can select for your next mailing ( click! ) . As is lazy model made during the last shipment was
taken up by clicking on the icon

I admit the arrow is a little big,


but it was asked so many times
where was this icon ...

Remember to change the subject of your mail to the new shipment . You can put anything, but not to
be recognized as a spammer you have this:

We have two solutions : Change the subject, yes, but it's a shame , it was good, I put three years to
find it, ... or simpler:

Click here:

And click on the trash corresponding to the last email sent list.

Once removed the last backup you send mail to imported by csv list ( previously clicked ) . You risk
nothing, addresses are wrong.

And the final result :

Campaigns and good for you to play !


This module is free but please donate ( link at the bottom of the module)
Eolia

PS : Some will ask me the value of this:

For info that allows you to change your translations in BO admin one hand and the internal files
module that are not managed by PrestaShop other. Personal system that does not work too bad.
While some knowledge of foreign languages , their contribution will be greatly appreciated and
translation files will be integrated into future updates .
The reset option reinstall all files and parameters if bug or blocking after a false manipulation .

FAQ:

1) MODULE DOES NOT PROPERLY INSTALLED


Unzip the archive, copy the entire directory newsletteradmin in your modules directory.
Copy track.php file (contained in scripts/files) to the root of your site.
Copy newsletters directory (contained in scripts/manage ) to the root of your site and give rights to
755 or 777 depending on your accommodation.
tiny.zip download , unzip and copy tiny_mce in your /js ( delete the old tiny_mce if any).
Go to the Modules tab -> Send a newsletter and install the module without care errors.
Possibly modify the rights of repertories: cron , logs, mails and translations to 777 if you are having
problems writing.

2 ) THE MODULE SEEMS TO WORK BUT ALL MAILS ARE IN FAIL


Verify that the mail function works on your server by sending a test email via the tab: "Advanced
Settings" - > Emails .
If it works , make sure the subdirectory mails/"your_iso_code" has been created in the directory
/mails of the module and it is not empty ( it must contain three files : index.php , and newsletter.txt
newsletter.html ) . If this directory does not exist copy and rename the mails/en directory in
mails/"your_iso_code". (ex. mails/es, mails/de, etc)

3) THE RATE OF RECEIPT ARE DOWN


The tracking is not 100% reliable , far from it .
Explanation: To find out who opened an email it necessarily be a request to your server, the request
to initiate a link ( on a blank image ) is inserted in the mail that returns the opening info .
Some ISPs block this type of queries , some users block downloading images , others receive in text
mode and then you fall into some unwanted spam or directly ( unrecognized address on noncompliant, forbidden words , blacklisted sender , etc. .... ) .

4) LOGO IS DISPLAYED IN ATTACHED PART OF MY NEWSLETTER


We must change the mail.php class in the /classes directory of your shop or create an override.
Ligne 145 (Prestashop version 1.4.1) replace:

$templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.'logo_mail.jpg')) ? $message>attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo_mail.jpg'))) :


((file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new
Swift_File(_PS_IMG_DIR_.'logo.jpg'))) : '');

By:
$templateVars['{shop_logo}'] = Tools::getShopDomain(true,
true).__PS_BASE_URI__.'img/logo_mail.jpg' ;

To Presta 1.5 (jusqu' 1.5.1)


replace:
Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL')))) :
((file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new
Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO')))) : '');

by:
Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL')))) :
Tools::getShopDomain(true, true).__PS_BASE_URI__.'img/logo_mail.jpg' ;

To 1.5.2 (yes all keep this bug, although we update the files ...)
comments this part:
else
if (file_exists(_PS_IMG_DIR_.'logo.jpg'))
$template_vars['{shop_logo}'] = $message->attach(new Swift_Message_Image(new
Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO'))));

To 1.5.4 and 1.5.5 (really stubborn zozos!) comments these lines (249 - 251)
/* don't attach the logo as */
//if (isset($logo))
// $template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new
Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));

and replace the previous paragraph by:


if (Configuration::get('PS_LOGO_MAIL') !== false &&
file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop))){
$logo =
_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop);
$template_vars['{shop_logo}'] = $logo;
}
else
{
if
(file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop))){
$logo =
_PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop);
$template_vars['{shop_logo}'] = $logo;
}
else
$template_vars['{shop_logo}'] = '';
}