Sfoglia il codice sorgente

Nueva libreria templates email.

Nermosis 3 anni fa
parent
commit
90cce21f69

+ 1 - 1
application/config/autoload.php Vedi File

89
 |
89
 |
90
 |    $autoload['helper'] = array('url', 'file');
90
 |    $autoload['helper'] = array('url', 'file');
91
  */
91
  */
92
-$autoload['helper'] = array("funciones", "url");
92
+$autoload['helper'] = array("funciones", "email_templates", "url");
93
 
93
 
94
 /*
94
 /*
95
 | -------------------------------------------------------------------
95
 | -------------------------------------------------------------------

+ 56 - 0
application/helpers/email_templates_helper.php Vedi File

1
+<?php
2
+if (!function_exists("emailInicioProcesoDescarga")) {
3
+    function emailInicioProcesoDescarga($fechaInicioProceso, $arrayArchivos)
4
+    {
5
+        $asunto = "Inicio descarga y proceso de archivos de licitaciones";
6
+        $archivosEmail = "";
7
+        foreach ($arrayArchivos as $file) {
8
+            $archivosEmail .= "<p>" . $file . "</p>";
9
+        }
10
+        $cuerpo = "<!DOCTYPE html>
11
+		<html lang='en'>
12
+		<head>
13
+			<meta charset='UTF-8'>
14
+		</head>
15
+
16
+		<body style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px;'>
17
+			<div class='contenedor' style='max-width:900px; width:100%; margin:0px auto;'>
18
+				<div class='texto-inicio'>
19
+					<p><strong>A continuación se mostraran los ficheros implicados en el proceso de descarga a fecha :" . $fechaInicioProceso . ".</strong></p>
20
+				</div>
21
+				<div class='campos'>
22
+                    $archivosEmail;
23
+				</div>
24
+			</div>
25
+		</body>
26
+		</html>";
27
+
28
+        $email = "chcalvoleon@mindden.com";
29
+        enviarEmail($asunto, $cuerpo, $email, false);
30
+    }
31
+}
32
+
33
+if (!function_exists("emailFinProcesoDescarga")) {
34
+    function emailFinProcesoDescarga($fechaInicioProceso)
35
+    {
36
+        $asunto = "Fin descarga y proceso de archivos de licitaciones";
37
+
38
+        $cuerpo = "<!DOCTYPE html>
39
+		<html lang='en'>
40
+		<head>
41
+			<meta charset='UTF-8'>
42
+		</head>
43
+
44
+		<body style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px;'>
45
+			<div class='contenedor' style='max-width:900px; width:100%; margin:0px auto;'>
46
+				<div class='texto-inicio'>
47
+					<p><strongEl proceso de importación con fecha $fechaInicioProceso ha terminado.</strong></p>
48
+				</div>
49
+			</div>
50
+		</body>
51
+		</html>";
52
+
53
+        $email = "chcalvoleon@mindden.com";
54
+        enviarEmail($asunto, $cuerpo, $email, false);
55
+    }
56
+}

+ 4 - 5
application/helpers/funciones_helper.php Vedi File

76
 
76
 
77
         }
77
         }
78
 
78
 
79
-        unset($conjunto);
80
         gc_collect_cycles();
79
         gc_collect_cycles();
81
         /*$query = $this->db->query($sql);
80
         /*$query = $this->db->query($sql);
82
         $result = $query->result();
81
         $result = $query->result();
83
         $query->free_result();*/
82
         $query->free_result();*/
84
 
83
 
85
-        return $CI->db->insert_id();
84
+        return count($conjunto);
86
     }
85
     }
87
 }
86
 }
88
 
87
 
171
         $config['protocol'] = 'smtp';
170
         $config['protocol'] = 'smtp';
172
         $config['smtp_host'] = 'smtp.gmail.com';
171
         $config['smtp_host'] = 'smtp.gmail.com';
173
         $config['smtp_user'] = 'chcalvoleon@mindden.com';
172
         $config['smtp_user'] = 'chcalvoleon@mindden.com';
174
-        $config['smtp_pass'] = '';
173
+        $config['smtp_pass'] = '4lb1R2014';
175
         $config['smtp_crypto'] = 'ssl';
174
         $config['smtp_crypto'] = 'ssl';
176
         $config['smtp_port'] = 465;
175
         $config['smtp_port'] = 465;
177
         $config['mailtype'] = 'html';
176
         $config['mailtype'] = 'html';
194
         }
193
         }
195
 
194
 
196
         if ($print_result) {
195
         if ($print_result) {
197
-            echo $CI->email->send(false);
198
-            echo $CI->email->print_debugger();
196
+            $CI->email->send(false);
197
+            $CI->email->print_debugger();
199
         } else {
198
         } else {
200
             $CI->email->send(false);
199
             $CI->email->send(false);
201
         }
200
         }