Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Add a Mailing contact automatically to a mailing list

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
pythonautomatedmailingodoo.shv12
12 Odpowiedzi
14519 Widoki
Awatar
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
Awatar
Odrzuć
Awatar
Pierre de Giorgio
Najlepsza odpowiedź

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
Awatar
Odrzuć
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.

Awatar
Mike Lorusso
Najlepsza odpowiedź

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
Awatar
Odrzuć
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

Awatar
Chris TRINGHAM
Najlepsza odpowiedź

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
    Awatar
    Odrzuć
    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

    Awatar
    HsuMonKo
    Najlepsza odpowiedź

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

    0
    Awatar
    Odrzuć
    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

    Podoba Ci się ta dyskusja? Dołącz do niej!

    Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

    Zarejestruj się
    Powiązane posty Odpowiedzi Widoki Czynność
    Automated action with python expression Rozwiązane
    action python automated odoo.sh v12
    Awatar
    Awatar
    6
    mar 24
    10714
    Grant portal access automatically when contact is created Rozwiązane
    automated portal-user odoo.sh v12
    Awatar
    Awatar
    Awatar
    Awatar
    Awatar
    4
    paź 24
    12099
    How to use "import <module>" in automated action in Odoo.sh 11.0? Rozwiązane
    action python automated automation odoo.sh
    Awatar
    Awatar
    Awatar
    2
    kwi 25
    18995
    How to code Automated Action to update a ManytoOne custom field to match source field?
    automated v12
    Awatar
    Awatar
    2
    lip 19
    6676
    Add newly created Leads to Newsletter Mailing List
    automated mailing crm.lead
    Awatar
    0
    lip 23
    2311
    Społeczność
    • Samouczki
    • Dokumentacja
    • Forum
    Open Source
    • Pobierz
    • Github
    • Runbot
    • Tłumaczenia
    Usługi
    • Hosting Odoo.sh
    • Wsparcie
    • Aktualizacja
    • Indywidualne rozwiązania
    • Edukacja
    • Znajdź księgowego
    • Znajdź partnera
    • Zostań partnerem
    O nas
    • Nasza firma
    • Zasoby marki
    • Skontaktuj się z nami
    • Oferty pracy
    • Wydarzenia
    • Podcast
    • Blog
    • Klienci
    • Informacje prawne • Prywatność
    • Bezpieczeństwo Odoo
    الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

    Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

    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