Topic: Newsletter 1.0.1

##
##
##      Mod title: Newsletter
##
##      Mod version: 1.0.1
##   Works on PunBB: 1.2.11
##     Release date: 2006-05-21
##           Author: El Bekko (elbekko@gmail.com)
##
##      Description: Lets you send out newsletters to users that have 
##                     subscribed to it.
##
##  Difference with
## previous version: Small bugfixes
##
##   Affected files: include/email.php
##
##       Affects DB: Yes
##
##            Notes: Requires PHP 4.3.0 or up
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Download

2

Re: Newsletter 1.0.1

Hi

How can I make that guests can sign-up for newsletter too ? ... They can sign-up but newsletter is sent only to members !!

Re: Newsletter 1.0.1

You would have to rewrite the mod quite a bit tongue

4

Re: Newsletter 1.0.1

Then how can I make that when guests click on nesletter link that they get you dont have permission etc .....

Re: Newsletter 1.0.1

Normally guests shouldn't be allowed to sign up =/
Newsletter.php

if($pun_user['is_guest'])
    message($lang_common['No view']);

So no, they can't =/

6

Re: Newsletter 1.0.1

But there is not such line in Newsletter.php !

7

Re: Newsletter 1.0.1

ok now there is ... wink

8

Re: Newsletter 1.0.1

It also seems that if a member enters different email than what he registeres with the newsletter is not send !

Re: Newsletter 1.0.1

Indeed not, I put that in as an extra check wink
The email entered must match the email stored in the DB, else nothing happens wink

10

Re: Newsletter 1.0.1

yep wink .... Can this be undone wink ... I am sure it is again some one line thing big_smile

Re: Newsletter 1.0.1

replace

if(isset($_POST['sub']))
{
    $email = $db->escape($_POST['email']);
    $db->query("UPDATE ".$db->prefix."users SET newsletter='true' WHERE email='$email' AND id='".$pun_user['id']."'") or die(mysql_error());
    redirect($_SERVER['PHP_SELF'], "Subscribed");
}
if(isset($_POST['unsub']))
{
    $email = $db->escape($_POST['email']);
    $db->query("UPDATE ".$db->prefix."users SET newsletter='false' WHERE email='$email' AND id='".$pun_user['id']."'") or die(mysql_error());
    redirect($_SERVER['PHP_SELF'], "Unsubscribed");
}

with

if(isset($_POST['sub']))
{
    $email = $db->escape($_POST['email']);
    $db->query("UPDATE ".$db->prefix."users SET newsletter='true' WHERE id='".$pun_user['id']."'") or die(mysql_error());
    redirect($_SERVER['PHP_SELF'], "Subscribed");
}
if(isset($_POST['unsub']))
{
    $email = $db->escape($_POST['email']);
    $db->query("UPDATE ".$db->prefix."users SET newsletter='false' WHERE id='".$pun_user['id']."'") or die(mysql_error());
    redirect($_SERVER['PHP_SELF'], "Unsubscribed");
}

12

Re: Newsletter 1.0.1

It is not working sad

Re: Newsletter 1.0.1

Guests still can't subscribe and the user's email isn't updated, no. First thing won't work with this setup, and the second thing is just plain stupid to do tongue

14

Re: Newsletter 1.0.1

I tried with a member and different email wink ... and nothing ...

Re: Newsletter 1.0.1

WHy on earth would someone subscribe with a different email? =/

16

Re: Newsletter 1.0.1

Ok elbekko tell me then how can I send the newsletter to all members ? That means they don't subscribe(I take newsletter link off the menu) but newsletter is still sent to them .... This way as it is I cannot use it but would really like too since template system is great just great  smile

Re: Newsletter 1.0.1

Send it to all members? Why not just use the mass email plugin then? tongue

18

Re: Newsletter 1.0.1

hehe this is why : http://punbb.org/forums/viewtopic.php?id=11879

sad

19 (edited by Smartys 2006-06-04 01:31)

Re: Newsletter 1.0.1

Which sounds like it's an issue with the format of an email address: go see what the actual address is

20

Re: Newsletter 1.0.1

It is simple email address .... something@email.com !

I get this on couple of different servers ! .... different hosts and punbb 1.2.11 and 1.2.12 !

21

Re: Newsletter 1.0.1

bump elbekko ... can you please tell me how to send newsletter to all users big_smile

Re: Newsletter 1.0.1

Subscribe them all to it by doing a query in phpMyAdmin? Or using the Broadcast Email mod?

Re: Newsletter 1.0.1

iatbm wrote:

It is simple email address .... something@email.com !

I get this on couple of different servers ! .... different hosts and punbb 1.2.11 and 1.2.12 !

Err, what's the something?

24

Re: Newsletter 1.0.1

viktor@email.com ! sad  ... this is email

Re: Newsletter 1.0.1

That is quite odd: I couldn't tell the issue without looking at your setup