Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Add a Mailing contact automatically to a mailing list

Odebírat

Get notified when there's activity on this post

This question has been flagged
pythonautomatedmailingodoo.shv12
12 Odpovědi
14687 Zobrazení
Avatar
Chris Leray

Hi,I am trying to find a way using an automated action to add contact to a specific mailing list once the contact has been created into Mailing contact.

I created an automated action to create a contact to Maling list contact as soon as a new contact is added, this is working fine: https://ibb.co/HdpsNJv

But I can't find a way to add this contact to a specific mailing list.  I tried that but it does not work: https://ibb.co/wSg1S6Y

Any advice?  thanks 


1
Avatar
Zrušit
Avatar
Pierre de Giorgio
Nejlepší odpověď

For Odoo 12 you can try putting all of this is python code. This is how I did it. I also do a quick check to make sure the email address doesn’t exist before creating the new entry. If you do it as outlined in the above example, try changing the line for the mailing lists from [1,2] to ([6,0,[1,2])]. That should eliminate the need for the second automated action.

My example also eliminates the need for the second automated example.

Hope this helps.

contact_name = record.name
contact_email = record.email
contact_company = record.parent_id.name

ref_model = env[‘mail.mass_mailing.contact’]
existing_records = env[‘mail.mass_mailing.contact’].search([(’email’, ‘=’, contact_email)])
if len(existing_records) == 0:
new_entry = ref_model.create({‘name’:contact_name, ’email’:contact_email,’company_name’:contact_company,’list_ids’ : [(6,0,[1])]})

2
Avatar
Zrušit
Chris TRINGHAM

Thanks Pierre, that's an improvement on my solution!

Tim Drinkwater

Any tips on how to modify this to work with the crm.lead model in 16 with a server action? Trying to add to a mailing list via the marketing automation app.

Avatar
Mike Lorusso
Nejlepší odpověď

Hi

There's a third-party app that adds contacts to mailing lists. It also has an action "Add contact to Mailing list". Perhaps this might help you?

Cheers

Mike

0
Avatar
Zrušit
Chris Leray
Autor

thanks for your feedback. I'd like to avoir adding or buyingt an extra module. I ll keep digging otherwise I will go for a specific module then.

thanks

Chris Leray
Autor

HI,

thanks for that.

Indeed it is not the best app as many app in Odoo, the are far from being compltete and need a lot of customization.

That's for me the pb with odoo system, many app but not complete unfortunately. But it does the job eventually.

cheers

Avatar
Chris TRINGHAM
Nejlepší odpověď

I think I have found a solution in Odoo 13.  Let's assume that you want to add the contact to two mailing lists that have Record IDs of 1 & 2.

FieldEvaluation TypeValue

Name (mailing.contact)

Python expression

record.name

Email (mailing.contact)

Python expression

record.email

Mailing Lists (mailing.contact)

Python expression

[1,2]

If you want to add them to Mailing Lists 1,2 & 7 then the Python expression would be [1,2,7]

Screenshots and more information

EDIT: As noted in the comments, this does not work in Odoo 12, so here is a workaround

Create another Automated Action to be triggered when a record is created on Mass Mailing Contact (mail.mass_mailing.contact) - so immediately after the first Automated Action (above):

  • Model = Mass Mailing Contact (mail.mass_mailing.contact)
  • Action To Do = Execute Python Code
  • Trigger Condition = On Creation
  • Apply on = Mailing Lists is not set
      [["list_ids","=",False]]
    Python Code
    record['list_ids'] = [1,2]
    0
    Avatar
    Zrušit
    Chris Leray
    Autor

    Hi,

    thanks for your feedback.

    I had a loot at the doc and I have tried this before but it still does now work.

    I am using v12 and indeed the model name is a bit different, as you can see but it looks the same:

    https://ibb.co/y4z8RCX

    There is no error message but it does not work. I have tried to split it into different automated action too but still the same.

    I really don't get it, this is weird.I agree it should work this way.

    Is there a way to track the log and see what it is executed in therm of query when the automated action is triggered?

    I don't see anything fro,m the log file..

    thank for your help, love the odootricks.tips :)

    Chris TRINGHAM

    Yes, although it's working in Odoo 13, I can't make it work in Odoo 12, which is strange!!

    Chris TRINGHAM

    Updated my answer with a workaround. I guess that someone with better Python knowledge could do all of this in one Automated Action :-)

    Chris Leray
    Autor

    Thanks a lot, it is indeed working this way.

    cheers

    Avatar
    HsuMonKo
    Nejlepší odpověď

    Hi, may i know the name of third-party app that adds contacts to mailing lists .

    0
    Avatar
    Zrušit
    Chris TRINGHAM

    https://apps.odoo.com/apps/modules/12.0/mass_mailing_partner/

    Chris Leray
    Autor

    Thanks,m I managed to do it through automated action

    Enjoying the discussion? Don't just read, join in!

    Create an account today to enjoy exclusive features and engage with our awesome community!

    Přihlásit se
    Related Posts Odpovědi Zobrazení Aktivita
    Automated action with python expression Vyřešeno
    action python automated odoo.sh v12
    Avatar
    Avatar
    6
    bře 24
    10797
    Grant portal access automatically when contact is created Vyřešeno
    automated portal-user odoo.sh v12
    Avatar
    Avatar
    Avatar
    Avatar
    Avatar
    4
    říj 24
    12323
    How to use "import <module>" in automated action in Odoo.sh 11.0? Vyřešeno
    action python automated automation odoo.sh
    Avatar
    Avatar
    Avatar
    2
    dub 25
    19402
    How to code Automated Action to update a ManytoOne custom field to match source field?
    automated v12
    Avatar
    Avatar
    2
    čvc 19
    6770
    Add newly created Leads to Newsletter Mailing List
    automated mailing crm.lead
    Avatar
    0
    čvc 23
    2394
    Komunita
    • Tutoriály
    • Dokumentace
    • Fórum
    Open Source
    • Stáhnout
    • Github
    • Runbot
    • Překlady
    Služby
    • Odoo.sh hostování
    • Podpora
    • Upgrade
    • Nestandardní vývoj
    • Edukační program
    • Najít účetní
    • Najít partnera
    • Stát se partnerem
    O nás
    • Naše společnost
    • Podklady značky
    • Kontakujte nás
    • Práce
    • Události
    • Podcast
    • Blog
    • Zákazníci
    • Právní dokumenty • Soukromí
    • Zabezpečení
    الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

    Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

    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