0 votes

I want to send an email to multiple users in Odoo 12 when a scheduler runs with custom data in email. I created my email template in the XML file. Also, I have a method which returns all my email addresses as a list. How can I loop over this list in email template in "email_to" field and get all email addresses and send the email to all of those emails?

closed with the note: Fixed
in Back-end by (10.5k points)
closed by | 456 views

1 Answer

+1 vote
Best answer

try like this:

 <field name="email_to">${object.get_emails_list()}


    def get_emails_list(self,):

        email_ids = ''

        for partner in partner_ids:


                email_ids = email_ids + ',' + str(partner.email)


        return email_ids
by (6k points)
selected by
204 questions
180 answers
269,052 users