File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed
Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ class MailComponent extends Component{
99
1010 protected $ _defaultConfig = [];
1111
12+
13+ /*
14+ * function to save the email data in db
15+ */
16+
1217 public function save ($ data ){
1318
1419 $ emailTable = TableRegistry::getTableLocator ()->get ('email ' );
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ public function initialize()
1818 $ this ->loadComponent ('Flash ' );
1919 }
2020
21+
22+ /*
23+ * function to input email and password of gmail
24+ */
2125 public function index ()
2226 {
2327 if ($ this ->request ->is ('post ' )) {
@@ -34,6 +38,12 @@ public function index()
3438 }
3539 }
3640
41+
42+ /*
43+ * function to connect gmail and read emails
44+ * @param array
45+ * @output array
46+ */
3747 protected function read_mail ($ data )
3848 {
3949 try {
@@ -160,7 +170,9 @@ protected function read_mail($data)
160170 echo 'Cannot connect ' . $ e ->getMessage ();
161171 }
162172 }
163-
173+ /*
174+ * function to list the mails
175+ */
164176 public function list (){
165177 $ session = $ this ->getRequest ()->getSession ();
166178 $ emailid = $ session ->read ('emailid ' );
@@ -172,6 +184,9 @@ public function list(){
172184 $ this ->set ('mails ' ,$ output );
173185 }
174186
187+ /*
188+ * function to view a particular the mail with attachment
189+ */
175190 public function view ($ id = null )
176191 {
177192 $ session = $ this ->getRequest ()->getSession ();
Original file line number Diff line number Diff line change 66class Email extends Table
77{
88
9+
10+ /*
11+ * function to initialize email model
12+ * @param array
13+ */
914 public function initialize (array $ config )
1015 {
1116 parent ::initialize ($ config );
1217 $ this ->table ('email ' );
1318 $ this ->primaryKey ('id ' );
1419 }
15- public function getMails ($ email_id ){
16- $ this ->find ('all ' )->where (['email.to_email > ' => $ email_id ]);
17- }
20+
1821}
You can’t perform that action at this time.
0 commit comments