thanks for the reply … so i dont have to go http://localhost/atlantiasearchfinal1/protected/modules/SimpleMailer/ … this is wrong right … if i directly try to go to simplemailer it says it dosent exist … yea can you send me the code which renders the simplemailer in coloumn2 … also i dont have a casesensitive so the default would be true right … or do i have to define a casesensitive and if you can send a small example code that would be of great help … thanks a lot
Let’s just forget about the view layout (the column2 thing). Check your installation of SimpleMailer. Be sure you’re following to the letter the installation instructions because seems like it is not installed at all.
i installed it again man … i am still confused with crontab command … how to save it ??
but i should be able to access simple mailer … which i am not able to do so … can you please create a demo of simple mailer or something … i am sorry i am asking for a lot … but i have tried almost everything i knew and it still dosent work … i need to implement this … please help me with this … thanks a lot …
If you’re using Windows I’m afraid I can’t help you since I use Linux. You always have Google to find out how to do things.
I’m gonna give you some instructions, however.
For crontab, at the console type:
crontab -e
Copy and paste the crontab lines into the editor and then save.
The installation document is quite explicit. I can’t tell you more because already everything is there. Also I can’t give you a ‘example code’ because all you need to know is exactly in the documentation.
Look for someone there were you work for help on how to do the required things in Linux.
Hey, for a solution to the limitation not being able to send to a list with a template, its simple, just add the name, lastname, etc fields in the same “SELECT email,name,etc FROM profile WHERE location=‘atlantis’;” sql query, and just fetch those values
Interesting. I can map the table columns names to template variables, as in ‘name’ would map to NAME. That, as you say, will definitely overcome the limitation of not being able to personalize emails when sending to a list.
Thank you. That’s a simple, clever solution. I’ll implement this as soon as I can.
If you followed the instructions to the letter you shouldn’t have any issues. If your app is not sending mail perhaps is because you or your system administrator didn’t configure properly your MTA.
I’m just starting to implement this extension in a project. Thanks to Chirvo and Yuga for all the great work.
For some reason I wasn’t able to get the db migration to work using yiic. In case anyone else had the same problem as I did, or anyone is trying this without access to a terminal session on the server (thus no yiic), here is a SQL dump of the tables that have to be created:
CREATE TABLE `sm_list` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`query` text,
`email_field` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) TYPE=InnoDB;
CREATE TABLE `sm_queue` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`to` varchar(255) NOT NULL,
`subject` varchar(255) NOT NULL,
`body` text NOT NULL,
`headers` text NOT NULL,
`status` int(11) NOT NULL,
`create_time` timestamp NULL DEFAULT NULL,
`update_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `to` (`to`),
KEY `subject` (`subject`),
KEY `status` (`status`)
) TYPE=InnoDB;
CREATE TABLE `sm_template` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(64) DEFAULT NULL,
`description` varchar(255) NOT NULL,
`from` varchar(255) DEFAULT NULL,
`subject` varchar(255) DEFAULT NULL,
`body` text,
`alternative_body` text,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) TYPE=InnoDB ;
(You don’t have to use the InnoDB engine if you don’t want to. I make it my default in order to take advantage of foreign key relationships.)
Congrats for the great module! I was planning to create the same module for a long time now (what a relieve).
I just wanted to let you know that I had to use it outside from another module (admin module) and in order to make it work I had to customize it a little bit:
/*
* --- SimpleMailer.components.SimpleMailer ----
* add init method with empty body
*/
public function init(){ }
...
/*
* --- SimpleMailer.SimpleMailerModule ----
* add the following row to the init method
*/
$this->setComponent('SimpleMailer', array('class' => 'SimpleMailer'));
....
/*
* Call it from an external module's controller
*/
Yii::app()->getModule('SimpleMailer')->getComponent('SimpleMailer')->send('johndoe@example.com', 'template_name', $template_vars);