SimpleMailer Forum Board
The Forum Board for the SimpleMailer extension

SimpleMailer is a module that helps the administrator on creating and delivering emails from your application. It is created because the need of a simple emailing system tightly integrated to the Yii apps I develop. After many unsuccessful tries to integrate PHPList to my apps I decided to write a solution that can fit in my shoes.

Hi chirvo,
Thank you for the extension. This is my first implementation of mail-queues, so thanks to you I'm having a good start point

I just started to dig into the code and have a couple of minor notices, mostly documentation related
1. Seems, in command to create migration option 'templateFile' should rather be used right after the command, e.g.

Also at the moment I'm getting Error 404 trying to reach http://DOMAIN/SimpleMailer. I'll give it a closer look tomorrow and will let you know if it was just a problem in my own implementation (which is highly possible) .

I've fixed the glitches you found in the documentation. Thanks for pointing them out.

yugene, on 28 June 2012 - 08:30 AM, said:

Also at the moment I'm getting Error 404 trying to reach http://DOMAIN/SimpleMailer. I'll give it a closer look tomorrow and will let you know if it was just a problem in my own implementation (which is highly possible) .

Ok, don't forget to keep me updated about the (possible) routing/url error. Maybe you just found another outstanding bug. Who knows?

Also, since you're also looking to implement email queues, if you have any suggestions or ideas about how to improve the extension I'll be more than glad to hear them.

Well, yes, appeared that's something you'd better to update , cause anyone on Linux machine won't be able to reach the module because of case-sensitive file-system. If I rename module to 'mailer', for example, use this name in config file as module ID and rename module main file and class respectively (MailerModule), then I can reach the module without any hassles.
I didn't dig deeper yet which way exactly paths are resolved to look for an appropriate module, so can't say for sure the definite cure, but 'simpleMailer' won't work too.

I had the same problem not so long time ago with one more module that had uppercase letters in its name, but that time I didn't have time to investigate the problem and just needed some pieces of the code from it. Happy this time I found the cause

Will work today on mailing system implementation, so will let you know if will find / invent anything interesting.

That's weird. I use Linux here and in my servers, didn't get any issues with SimpleMailer and broken URLs.

Strange then, on some free time will look into it.

Anyway, I have some results to share with you.
First of all, I really like the functionality provided with your module, it gave me even more then I even was thinking about. I think my client may like the idea of Mailing Lists as well .

Second, I found 2 bugs so far, both are db related:
1. sm_queue misses `headers` field, which is used in the code.
2. some indexes are wrongly set to be unique, these ones should be fixed to :

Okay, next - are just small comments, maybe you'll get any useful information from it:
1. I moved Send Preview Email above the iframe, as iframe has large height and it's not obvious there's more beneath.
2. I manually updated captions/links everywhere to something more neutral, e.g. 'Manage templates'
3. I use your module as a nested module, so to get properties values I call

Yii::app()->getModule('admin')->getModule('mailer')->sendEmailLimit

, which is quite long n such case
4. Also, well, sorry, but I renamed all classes to a shorter variant, e.g. 'MailerXxxx', Mailer::process(), hope you won't mind it
5. Also, my idea is maybe later (if will be needed) to implement SwiftMailer to be used with your module.

That's all for now.
Thank you for your module and hope my comments will be helpful somehow.
Back to mailing..

Hi Chirvo,
there're some more minor updates, maybe you would like to implement some of them into the library:
1. added getStatusName() to SimpleMailerEnqueue, to show not 0/1 but status text name.
2. in MailerCommand

I like the idea of changing the names of classes to something shorter. Being a KISS solution it's funny that one has to type ReallyLongNamesForClasses every time. Gonna use EMailer* to stick to the recommendations for creating Yii extensions. Also I'm gonna do the small changes in the views. You're right with your observations.

Thanks for taking some time of your weekend to try to figure out what happens there. I also gonna do a fresh installation of the module (I already made some changes you suggested) and gonna see what happens.

Hi Chirvo,
I've found the solution, and it's quite simple.
Usually I don't change

'urlManager' => array(
'caseSensitive' => false,
)

this parameter, and I didn't give enough attention the previous developer changed it
Docs are quite descriptive about the change:

Quote

Defaults to true. By setting this to false, the route in the incoming request will be turned to lower case first before further processing. As a result, you should follow the convention that you use lower case when specifying controller mapping (CWebApplication::controllerMap) and action mapping (CController::actions). Also, the directory names for organizing controllers should be in lower case.

So, maybe it's a good idea to put a notice about possible problems when installing a module if this parameter is changed.. It may save some time to other developers, I think. I will add this notice to modules description in guide as well.

I mostly finished integration of the library, only final tests on production are left (if client won't request additional functionality).
Module works stable and allowed to implement very convenient features just in few hours, so Thanks a lot one more time

Two more small comments:
1. I finally moved Send Preview right after the caption, and it looks more natural for me there.
2. I added Array $testData to TemplateController, and now previews and test emails are rendered with this test data (+ merged with global vars), it think it gives more natural view of templates, especially taking in notice a site admin ( who will handle templates ) isn't a programmer.

hey .. this is a perfect example and i want to implement just this .. the problem is i am not able to make it work .. in the usage when you say go to http::/yourdomain/SimpleMailer/createnewtemplate ..i can reach till simplemailer and then there is no create new template or how do i add the template and access simplemailer.. can you please send an example code or demo .. or can you please help me make it work .. thanks