Newsletter not Made Simple enough!

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
tamlyn

Newsletter not Made Simple enough!

Post by tamlyn »

I'm having issues with NMS 1.0-beta6 (and also latest svn) running on CMS 1.0.2.

It sends out emails OK but the links in the default email don't work. Firstly they don't show because they are wrapped in an tag with no text to click on. I fixed this by adding some text in the CreateLink method call but then the problem is that they are routed through admin/moduleinterface.php which doesn't work if whoever clicks the link is not currently logged in to the admin. I tried setting 'inline' to true and also the latest SVN where calguy1000 changed the calls to CreateFrontendLink but it doesn't seem to make any difference.

What am I doing wrong?
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: Newsletter not Made Simple enough!

Post by tsw »

strange, I don't have those problems (then again I'm not using html mails because it's evil ;)

give detailed steps on how to reproduce the problem and well take a look

(I think the biggest problem atm with bugs is that there aren't enough detailed information on how we can reproduce the bug, if we cant reproduce it we cant fix it either, so include everything you can think of including vital information like what email client are you using to read the mail, no one having these problems hasn't yet told that afaik)
tamlyn

Re: Newsletter not Made Simple enough!

Post by tamlyn »

How do you turn off html? I thought use of html was hard-coded into nms (line 214 or action.process_queue.php reads $mailer->IsHTML(true);).

As for reproducing the bug, I just installed a fresh version of CMS 1.0.2, installed NMS 1.0-beta6, added a mailing list (public or private, doesn't matter), added a couple of users, created a message with the default message body, created a job, ran the job. I've done this a couple of times and also tried the current svn code but it's the same every time.

I'm using thunderbird but the problem is in the emails sent out. Here's the source of one:

Code: Select all

<h1>Hello Tamlyn Rhodes</h1>
<p>If you have received this message to this email address: tam@zenology.co.uk it means that you are a member of one or more    lists on our website.  You have a number of options, you can ignore the message (this is probably safe to do),    or you can:    </p>
<ul>
    <li>Unsubscribe:  Just follow this link <a href="http://www.onixcabo.com/cms/moduleinterface.php?mact=NMS,m1_,unsubscribe_email,1&m1_showtemplate=&m1_uniqueid=04913d7b183e1c1478cad4ff066a62db"></a></li>
    <li>Change your preferences:  Just follow this link <a href="http://www.onixcabo.com/cms/moduleinterface.php?mact=NMS,m1_,changeprefs_email,1&m1_showtemplate=&m1_uniqueid=04913d7b183e1c1478cad4ff066a62db"></a></li>
    <li>Confirm that this is a valid email address by following this link: <a href="http://www.onixcabo.com/cms/moduleinterface.php?mact=NMS,m1_,confirm_email,1&m1_showtemplate=&m1_uniqueid=04913d7b183e1c1478cad4ff066a62db"></a></li>

</ul>
Have a good day, and again, welcome.
<p> </p>

(the admin dir is called 'cms' because the server's running ensim which aliases 'admin' for itself.)

EDIT: just installed NMS on a different website on a different server running different versions of everything (PHP, MySQL, Apache etc) on cPanel and it behaves in exactly the same way. :/
Last edited by tamlyn on Tue Oct 31, 2006 5:30 pm, edited 1 time in total.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: Newsletter not Made Simple enough!

Post by tsw »

try svn version...
tamlyn

Re: Newsletter not Made Simple enough!

Post by tamlyn »

The links are now clickable and don't require me to log in but they still don't do anything (i.e. I click on the unsubscribe link but it doesn't unsubscribe me). Frontend and backend module links use a different format and you can't convert one to the other just by replacing the admin dir string. You need to generate them as 'inline' links with CreateLink() or CreateFrontendLink(). Oh, hang on, that's what you are doing. So why are the links still coming out as admin links?

Just out of interest though how is it that v1.0-beta6 worked for other people but not me?
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: Newsletter not Made Simple enough!

Post by tsw »

it is a hack (as stated in the code ;)

I dont have any good ideas atm... Ill have to dig it more...
tamlyn

Re: Newsletter not Made Simple enough!

Post by tamlyn »

OK after studying cms_module_CreateLink() I think the problem arises from the fact we are creating a link in the admin that will be used in the frontend. Some kind of manipulation of $returnid should help though I haven't been able to work out if it should be set to '', -1 or a real content id.
tamlyn

Re: Newsletter not Made Simple enough!

Post by tamlyn »

It seems the only way to get a proper link out of CreateLink() is to provide it with a real (front end) returnid and set inline to false (huh?). For example:

Code: Select all

$this->smarty->assign('confirmurl', $this->CreateLink($id, 'confirm_email', $returnid, '',
                   array('showtemplate'=>0,'uniqueid'=>$message['uniqueid']), '', true));
Where $returnid >= 0

So I think that means we need a preference setting to specify which content page should handle nms requests and this value should be used for the returnid since in the admin pages returnid is just an empty string.

EDIT: oh but I forgot to mention that once I get the links 'working' I receive the "parameters are missing from the request" error. But that seems to be a different problem caused by the check for the presence of an 'email' parameter in action.unsubscribe_email.php when it should be also checking for an equivalent 'uniqueid' parameter.
Last edited by tamlyn on Wed Nov 01, 2006 12:47 am, edited 1 time in total.
mderbyshire

Re: Newsletter not Made Simple enough!

Post by mderbyshire »

tamlyn wrote: ...
Just out of interest though how is it that v1.0-beta6 worked for other people but not me?
That's not the case - it doesn't work for me either. I've been having the exact same issues as you, and have been hoping for a fix for a long time. I did manage to fix the links pointing to the admin panel by replacing 'CreateLink' with 'CreateFrontendLink', but as you mentioned yourself, they still don't work. Also, I never did manage to get any anchor text between the tags it generates for the unsubscribe URL's in emails - I tried hardcoding some in, but it never worked for me. I have very little PHP knowledge, however, so all i've really been doing is hoping for a fix in the near future.

Just thought i'd let you know that you aren't alone :-)
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: Newsletter not Made Simple enough!

Post by tsw »

I havent forgotten this task, its just that Ive been way too busy with other work and school atm. I promise Ill try to look at it in near future
tamlyn

Re: Newsletter not Made Simple enough!

Post by tamlyn »

No worries tatu. I'm in much the same situation but I need this for a job so I'd be quite happy to work on it if you give me some pointers as to where to look.

Would it be fair to say this is more alpha level code than beta? I mean if something as basic as the subscribe/unsubscribe isn't working then it can't have been tested very thoroughly. I'm not knocking it, it looks like good code, but would you use it in a production environment?
Foton
Forum Members
Forum Members
Posts: 32
Joined: Fri May 05, 2006 10:41 pm

Re: Newsletter not Made Simple enough!

Post by Foton »

I noticed that the unsubscribe-link in the confirmation email removes the user from the list and does not remove the user from the users-list. So that link works for me (using CMSMS 1.0.3 and NMS 1.0.1).
It took me a couple of hours to noticed that!...
Locked

Return to “Modules/Add-Ons”