diff --git a/source/app/controllers/helper.py b/source/app/controllers/helper.py index e1f346e..b402199 100644 --- a/source/app/controllers/helper.py +++ b/source/app/controllers/helper.py @@ -295,6 +295,8 @@ class SendMail(object): message['CC'] = options['copia'] message['Subject'] = options['asunto'] message['Date'] = formatdate(localtime=True) + if options['confirmar']: + message['Disposition-Notification-To'] = message['From'] message.attach(MIMEText(options['mensaje'], 'html')) for f in options['files']: part = MIMEBase('application', 'octet-stream') diff --git a/source/app/models/main.py b/source/app/models/main.py index 20cf77b..928e3f6 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -179,7 +179,8 @@ class Configuracion(BaseModel): if keys['fields'] == 'correo': fields = ('correo_servidor', 'correo_puerto', 'correo_ssl', 'correo_usuario', 'correo_contra', 'correo_copia', - 'correo_asunto', 'correo_mensaje', 'correo_directo') + 'correo_asunto', 'correo_mensaje', 'correo_directo', + 'correo_confirmacion') data = (Configuracion .select() .where(Configuracion.clave.in_(fields)) @@ -4354,6 +4355,7 @@ def test_correo(values): options = { 'para': values['correo_usuario'], 'copia': ccp, + 'confirmar': bool(values['correo_confirmacion'].replace('0', '')), 'asunto': values['correo_asunto'], 'mensaje': values['correo_mensaje'].replace('\n', '
'), 'files': [], diff --git a/source/static/js/ui/admin.js b/source/static/js/ui/admin.js index 84d5109..d91cb41 100644 --- a/source/static/js/ui/admin.js +++ b/source/static/js/ui/admin.js @@ -373,11 +373,11 @@ var emisor_correo = [ {}]}, {cols: [ {view: 'text', id: 'correo_copia', name: 'correo_copia', - label: 'Con copia a: '} + label: 'Con copia a: ', bottomLabel: 'Uno o más correos electrónicos separados por comas'} ]}, {cols: [ {view: 'text', id: 'correo_asunto', name: 'correo_asunto', - label: 'Asunto del correo: '} + label: 'Asunto del correo: ', bottomLabel: 'Puedes usar campos: {serie}{folio}'} ]}, {cols: [ {view: 'textarea', id: 'correo_mensaje', name: 'correo_mensaje', @@ -385,7 +385,11 @@ var emisor_correo = [ ]}, {cols: [ {view: 'checkbox', id: 'correo_directo', name: 'correo_directo', - label: 'Enviar directamente: '}, + label: 'Enviar directamente: ', bottomLabel: 'Envia la factura directamente al cliente al generarse'}, + {}]}, + {cols: [ + {view: 'checkbox', id: 'correo_confirmacion', name: 'correo_confirmacion', + label: 'Solicitar confirmación: ', bottomLabel: 'Solicita al cliente la confirmación de recepción'}, {}]}, {minHeight: 25}, {cols: [{},