Newsletter Plugin Newsletter Plugin
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Newsletter Plugin

Started by Stramm, January 17, 2007, 02:28:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stramm

This one is pretty much a pluginized version of the 1.3 mod I posted ~ 2 years ago. Therefore the code isn't that pretty but works. No code cleanup or improvements added except that it only works with the modpack.
Reason for the restriction to the modpack: I do not like newsletter scripts to much. But sometimes they come in pretty handy. Still the users should have the possibility to opt out. This they can do when unchecking 'Allow admin emails' in their profile. Or the similar setting in a bridged environment (should work bridged but I haven't tested that at all).

How does it work:
Unzip the archive in the plugin dir, install it via the coppermine config. Now you'll see a new button 'Newsletter' in the admin menu. A click on it gives you the option to 1. send mail or 2. check the archive. Check archive lets you view/ delete old newsletters you've sent. Send mail allows you to create a new mail template or to edit an old one and resend it.
When you've created/ edited your template (you can use the placeholder {username} to insert the username), hit send and you come to an options page.

How to send mails: php_mail or sendmail, php_mail means what you've set in coppermine config or you can force sendmail (excluding coppermines mailer include)
Sendmail path: The path to sendmail if you've chosen above to use it
Server OS: should be self detecting, uses \r\n as linefeed for win and \n for nix
How many mails per batch: Best is to use a low value even if that needs longer. Timeout problems won't occur or at least not that often. The newsletter will send the number of set emails, refreshes the page and sends the next batch
Send as preview: If checkt the plugin won't send the newsletter but only a preview to the admin
Automatic wordwrap after 72 chars: If checked the wordwrap every 72 chars is enabled

Click send and the plugin will send away

What if I run into a timeout: I only experienced that with huge batches and/ or invalid email addies.
Check the address bar and find an entry lastmailed=xxx, raise the xxx number and hit the browsers reload button. The plugin will continue to send
eg lastmailed=180, your batch size is 20, then set it to lastmailed=200, the plugin will continue at email nr. 200
or you set nummails=1 (batch size), then you'll see exactly what email makes the troubles, then raise lastmailed by one and edit the trouble email.

edit: Translations are welcome (see plugin/newsletter/lang/english.php as reference, use the lang file naming scheme coppermine uses - see the lang dir)

twogayther

#1
Hi

I have a probleme with this plugin.
I install it and after when i use menu newsletter i have this error :
Fatal error: main() [function.require]: Failed opening required 'plugins/newsletter/include/functions.inc.php' (include_path='/mnt/105/sdb/c/a/godeboy/include:.:/usr/php4/lib/php') in /mnt/105/sdb/c/a/godeboy/plugins/newsletter/newsletter.php on line 9

In adress bar i can see this url http://mysite.com/index.php?file=newsletter/newsletter

Isn't it here the problem ... ?
Thank and excuse because i don't speak english not at all

EDIT : I find the first problem the file function.inc.php was not in the good place .
but i have always a problem . Did anyone test it ?

Stramm

post a real url, don't rename the folder name 'newsletter'

twogayther

#3
Hi,

I don't have rename folder newsletter
real url is http://godeboy.free.fr/index.php?file=newsletter/newsletter

here's the debogage info :

While executing query "SELECT count(user_id) AS num FROM `godeboy`.coppermine_users  WHERE user_email <> '' AND  = '1' AND user_active = 'YES'" on

mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= '1' AND user_active = 'YES'' at line 1

Fichier: /mnt/105/sdb/c/a/godeboy/include/functions.inc.php - Ligne: 249

Stramm

I don't see your coppermine gallery when opening http://www.mysite.com

and I clearly have written (in bold) in the first post of this thread, third sentence, that this plugin only works when you have the modpack installed. In the following sentences I have explained why...

Again, if you do not have the modpack installed it won't work. If you want support, post true URLs. Urls, when I click them that your coppermine gallery opens.

Don't post debug output unless requested. It tells you that above the debug output. I'm going to edit your above post to unclutter this thread. Please do more reading...

twogayther

Hi,

I explain you i dont' speack not at all english but i understand you're angry ...
but untderstand I do an personnal job when i wrote in english

I don't need help so ..

Not a problem
Have a nice day .
bye

angeldevil

Great work Stramm!! thank you  ;D

finally one newsletter!

I've traslated in italian language
a

Stramm

Thanks for the translation, much appreciated

Pascal YAP

#8
Mornin' Stramm,

Here's French lang

Because my Zipper is out today, i can'nt send a ZIP lang  ???
Copy and Past in a new file nammed french.php

   PYAP

<?php
/**************************************************
  CPG Newsletter Plugin for Coppermine Photo Gallery
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.10
  Newsletter version: 1.01 Translation by PYAP
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/
if (!defined('IN_COPPERMINE')) 
{
die('Not in Coppermine...');
}
$lang_newsletter = array(
  
'uninstall' => 'Voulez-vous supprimer la table SQL dans laquelle les infos de votre Newsletter sont stockées ?',
'admin_title' => 'NewsLetter',
    
'title' => 'NewsLetter',
'user' => 'Utilisateur',
'pw' => 'Mot de Passe',
'welcome' => 'Bienvenue sur le plugin NewsLetter... ',
'mail_menu' => 'Menu',
'send' => 'Expédiez le Mail',
'archive' => 'Controlez Archive',
'active_users' => 'Nombre de emails confirm&eacute; dans la base de donnés : ',
'archive_welcome' => 'Archive Newsletter ',
'show_archive_mail' => 'Montrez',
'delete_archive_mail' => 'Supprimez',
    
'subject' => 'Sujet de la NewsLetter',
'content' => 'Contenu de la NewsLetter',
'chose_send' => 'Faites une sélection',
'create_new' => 'Créez un nouvel email',
'create_edit' => 'Editez un email existant et expédiez-le de nouveau',
'sending' => 'Expédié...',
'date' => 'Date',
'send' => 'Expédiez le email',
'nomail_error' => 'ATTENTION : Vous avez sans doute oublié de taper une adresse email !',
'sendmail_path' => 'Sendmail-path<br>(si vous avez choisi sendmail, <br>incl. option [-t])',
'batch' => 'Combien de email désirez-vous expédier par batch ?',
'send_type' => 'Comment expédier les emails ?',
'serveros' => 'Server OS',
'preview' => 'Expédiez Ã  vous-même un preview',
'wordwrap' => 'Automatic wordwrap apr&egrave; 72 caracteres',
'sendmail_error' => 'Mauvais chemin (path) vers sendmail ou pas installé',
'edit_archive_mail' => 'Sélectionnez',  
'mailing' => 'Mailing ...',  
'all_sent' => 'Tous les emails sont expédiés',
'preview_sent' => 'La prévisualisation du email envoyé<br><br>Vous pouvez fermer cette fenetre navigateur.<br><br><br><b>Si vous &egrave;tes satisfait de votre email, uncheck \'Expediez Ã¨ vous-meme un preview\' et tapez \'Expédiez\' de nouveau !!!</b>',
'continue' => 'Continuez',  
'click' => 'click',  
'wait' => 'Attendez quelques instants...',  
  );
?>


edit by Stramm : attached the lang file as zip... thanks PYAP :)

marpessa

I'd love to use this but I keep getting that error when I click on "newsletter" button.

Critical error: There was an error while processing a database query


Help? :)

Nibbler

Enable debug mode and post the mysql error message (not the entire debug output) you get when you replicate the error.

Stramm

have you read the very first post of this thread? Especially that part...

Quoteit only works with the modpack

Hein Traag

Goodmorning!

dutch.php added as zip.

Hein

marpessa

#13
Quote from: Stramm on February 13, 2007, 09:42:04 AM
have you read the very first post of this thread? Especially that part...


Oh... Where can I find the modepack and would it work with 1.4?

Hein Traag

In the first post it is said it only works with the modpack (which Stramm made).
So you might want to go look in here http://forum.coppermine-gallery.net/index.php?board=81.0

Stramm

Hein, thank you for the translation ;D

antisa33

Hello
The newsletter module seems good but i don't want to install the MOD pack, how can i do ?
Best regards

Joachim Müller

Not at all. Just read the posting just two above yours (posted by HJein): this mod will only work with the modpack. That's it. If you need it as standalone mod, go ahead and code it.

natalina

Hi, Stramm, Thank u very much for this plugin :) It works fine, just one question. When I send mail it is sent only to users who registered AFTER installig your mod. Can I manually insert others to Mysql table? If yes, please name the table & the field. Thanks.

Stramm

not after installing the mod but after installing the modpack. Your users need to tick in their profile the checkbox 'allow admin email'.
Auto checked when registering with the modpack

It's possible to use phpmyadmin to set that for all users. But it's not the purpose of this functionality