Oh, for your problem labasus, do you have the files in the modules directory? First I did put my files to plugins directory.
Here’s a snippet that will insert the records from an excel generated csv file into the EasyNewsletters subscribers table.
There are three parameters :
&table name of the subscribers DB table
&csv name of the csv file ( doesn’t need the .csv extension )
&csvpath path to the csv file on the server
The csv file should have the seven columns :
firstname, lastname, email, status, blocked, lastnewsletter, created ( see attached .csv file )
Ideally this could be incorporated into the EasyNewsletter module itself, maybe with a file upload feature, but that would take longer
<?php $table = (isset($table)) ? $table : 'easynewsletter_subscribers'; // name of the table for updating $csv = (isset($csv)) ? $csv : 'subscribers'; // name of the csv file for updating the table - doesn't need the .csv extension $csvpath= (isset($csvpath)) ? $csvpath : 'assets/csv/'; // path to the folder the csv file is stored in $basePath = $modx->config['base_path']; if (file_exists($basePath.$csvpath.$csv.".csv")){ $fp = fopen($basePath.$csvpath.$csv.".csv","r"); while($data=fgetcsv($fp,900000,",")){ $firstname = addslashes($data[0]); $lastname = addslashes($data[1]); $email = addslashes ($data[2]); $status = addslashes($data[3]); $blocked = addslashes($data[4]); $lastnewsletter = addslashes($data[5]); $created = addslashes($data[6]); $fields = array ('firstname' => $modx->db->escape($firstname), 'lastname' => $modx->db->escape($lastname), 'email' => $modx->db->escape($email), 'status' => $modx->db->escape($status), 'blocked' => $modx->db->escape($Measure), 'lastnewsletter' => $modx->db->escape($lastnewsletter), 'created' => $modx->db->escape($created)); $rs = $modx->db->insert($fields, $table); } } ?>
I tested it quickly, but if you have any problems, report back!


The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
# Easy Newsletter 0.3 # Created by: lichig # Language: Spanish # ------------------------------------------------------------------------ $lang_links_subscribers = "Suscriptores"; $lang_links_newsletter = "Newsletter"; $lang_links_configuration = "Configuración"; $lang_mailinglist = "Please input your name and e-mail to subscribe or unscubscribe our newsletter:"; $lang_mailinglist = "Por favor, ingrese su nombre y su E-mail para suscribirse o darse de baja a nuestro newsletter:"; $lang_firstname = "Nombre"; $lang_lastname = "Apellido"; $lang_email = "E-mail"; $lang_submit = "Enviar"; $lang_subscribe = "Suscribir"; $lang_unsubscribe = "Dar de baja"; $lang_alreadysubscribed = "Este E-mail ya se encuentra registrado."; $lang_notsubscribed = "Este E-mail no se encuentra en nuestro sistema."; $lang_subscribesuccess = "Gracias por suscribirse a nuestro Newsletter."; $lang_unsubscribesuccess = "Ha sido dado de baja de nuesto Newsletter."; $lang_notvalidemail = "El E-mail ingresado no es válido. Intente nuevamente."; $lang_newsletter_noposts = "No se ha creado ningún Newsletter aun."; $lang_newsletter_test = "Enviando a E-mail de prueba (Fue utilizada la dirección de E-mail especificada en <strong>configuration</strong>)."; $lang_newsletter_testmail = "Prueba"; $lang_newsletter_delete_alert = "¿Confirma Eliminar?"; $lang_newsletter_send_alert1 = "¿Confirma enviar el newsletter?"; $lang_newsletter_send_alert2 = "ATENCION!: El newsletter será enviado a TODOS los suscriptores."; $lang_newsletter_create = "Crear Newsletter"; $lang_newsletter_date = "Fecha"; $lang_newsletter_subject = "Título"; $lang_newsletter_status = "Estado"; $lang_newsletter_sent = "Enviado"; $lang_newsletter_action = "Acción"; $lang_newsletter_edit = "Editar"; $lang_newsletter_delete = "Eliminar"; $lang_newsletter_send = "Enviar"; $lang_newsletter_sending = "<h1>Enviando Newsletter a TODOS los suscriptores... Por favor espere.</h1>"; $lang_newsletter_sending_done1 = "<h2>E-mails enviados!</h2>Enviado "; $lang_newsletter_sending_done2 = " Para "; $lang_newsletter_sending_done3 = " suscriptores"; $lang_newsletter_sending_done4 = "<h2>Se produjo un Error</h2>Revise la <strong>Configuration</strong>."; $lang_newsletter_edit_header = "Crear Newsletter aquí."; $lang_newsletter_edit_subject = "Titulo:"; $lang_newsletter_edit_save = "Guardar newsletter"; $lang_newsletter_edit_update = "Newsletter Actualizada!"; $lang_newsletter_edit_delete = "Newsletter Eliminada!"; $lang_newsletter_edit_create = "Newsletter Creada!"; $lang_subscriber_noposts = "No hay suscriptores registrados."; $lang_subscriber_delete_alert = "¿Confirma Eliminar?:"; $lang_subscriber_edit_header = "Editar detalles de suscriptores."; $lang_subscriber_created = "Creado"; $lang_subscriber_firstname = "Nombre"; $lang_subscriber_lastname = "Apellido"; $lang_subscriber_email = "E-mail"; $lang_subscriber_edit_action = "Acción"; $lang_subscriber_edit_save = "Actualizar Suscriptor"; $lang_subscriber_edit_update = "Suscriptor Actualizado!"; $lang_subscriber_edit_delete = "Suscriptor Eliminado!"; $lang_config_header = "Editar configuración."; $lang_config_mail = "Método de envío"; $lang_config_mail_description = "Different kinds of mailing methods. SMTP is recommended."; $lang_config_mail_description = "Diferentes métodos de envío de E-mail (SMTP Recomendado)."; $lang_config_smtp = "Servidor SMTP"; $lang_config_smtp_description = "Su proveedor de host puede informarle sobre su servidor SMTP."; $lang_config_auth = "Autenticación SMTP?"; $lang_config_auth_description = "Solo utilizado en método SMTP. Usuario y contraseña SMTP Requerido."; $lang_config_true = "Si"; $lang_config_false = "No"; $lang_config_authuser = "Usuario SMTP"; $lang_config_authuser_description = "Usuario para autenticación SMTP. Generalmente es su dirección de E-mail."; $lang_config_authpassword = "Contraseña SMTP"; $lang_config_authpassword_description = "Contraseña para autenticación SMTP. Generalmente es la utilizada en su dirección de E-mail."; $lang_config_sendername = "Nombre de Remitente"; $lang_config_sendername_description = "El nombre que aparecerá como remitente."; $lang_config_senderemail = "E-mail de Remitente"; $lang_config_senderemail_description = "La dirección de E-mail que aparecerá como remitente."; $lang_config_lang_website = "Languaje - website"; $lang_config_lang_website_description = "Lenguaje utilizado en el formulario de suscripción."; $lang_config_lang_manager = "Language - manager"; $lang_config_lang_manager_description = "Lenguaje utilizado en el panel de administración"; $lang_config_save = "Guardar configuración"; $lang_config_update = "La configuración ha sido actualizada!";