Agregar confirmación de correo
This commit is contained in:
parent
524db01ac9
commit
aa9eea9dd5
|
@ -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')
|
||||
|
|
|
@ -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', '<br/>'),
|
||||
'files': [],
|
||||
|
|
|
@ -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: [{},
|
||||
|
|
Loading…
Reference in New Issue