0 votes
69 views

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.2k points)
closed by | 69 views

1 Answer

+1 vote
Best answer
hi

try like this:

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

 @api.multi

    def get_emails_list(self,):

        email_ids = ''

        for partner in partner_ids:

           

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

         

        return email_ids
by (5.8k points)
selected by
192 questions
163 answers
32 comments
39,435 users