Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

How to automatically attach a file to all outgoing email?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
attachmentemailissuetrackervcard
2 Respuestas
17969 Vistas
Avatar
Martin

In some legislations it is obligatory, to send certain company information with every business email, such as the tax number etc. Because having this long stuff in the signature is ugly, I prefer to attach a vcard ("vcf") file with all emails. This can be easily ignored by most and easily used by some.

How can I attach a file to every outgoing email? It is OK, if the file is always the same for all users of the same company. (My setup is one-company, btw.)

2
Avatar
Descartar
Avatar
Shaun Dawson
Mejor respuesta

One way that I can think of to accomplish what you are after is to create a module which defines a class that inherits from mail.mail.

You can override the send() function to first add your attachment to the mail message, and then call the superclass' send() function. That will give you exactly what you need, and probably configurability besides.

class autoattach_mail(osv.osv):
  _name='mail.mail'
  _inherit='mail.mail'

  def send(self, cr, uid, ids, auto_commit=False, recipient_ids=None, context=None):

    #TODO: add your attachment to each mail message in ids

    return super(autoattach_mail, self).send(cr, uid, ids, auto_commit=auto_commit, recipient_ids=recipient_ids, context=context)
1
Avatar
Descartar
Martin
Autor

I will definetely try this. I wonder, how I would make OpenERP use my derived class instead of the base class?

Shaun Dawson

It should do so automatically, if you set _name to the same thing as _inherit. You'll need to update the affected modules also, so when you run the server again, run it with "--update all".

Martin
Autor

It took some time for me, to get through the details, but now it works. I copied the complete send() method, and just added the attachment: with open("mycompany.vcf") as f: attachments.append(("mycompany.vcf", f.read()))

Shaun Dawson

Very nicely done!

Avatar
Omal Bastin
Mejor respuesta

Create a email template. In the advanced tab, there you can easily attach attachments. Then select this email template for sending mails

0
Avatar
Descartar
Martin
Autor

This works indeed, but all the support staff has still to remember to use the template with every outgoing email. It is just one click to use the template, but in my experience in most cases it will not be done. The question remains how to do this automatically. (Nearby, I could not find how to set the MIME type of the attachment. It should be Content-Type: text/x-vcard; charset=utf-8;)

Martin
Autor

Another (minor) problem with this approach is, that the VCard is visible in every comment sent out, taking a lot of screen real estate by default. One can probably solve this with a little bit of CSS, but still...

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
How remove signature from attachment in openerp 7.0
attachment email
Avatar
0
dic 16
4009
Sending email creates new attachment
attachment email
Avatar
0
feb 16
3726
How to use the correct language for outgoing email?
language email issuetracker
Avatar
Avatar
1
mar 15
5440
How to attach document to an email?
attachment document email
Avatar
0
mar 15
4322
Rental app - How to send several orders with their respective automatic attachments at the same time ?
attachment orders email Rental
Avatar
0
feb 25
1397
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now