Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5634 Weergaven

When I click on the send button, a wizard will be displayed.
I have a list of partners (partners--->[18, 3, 19, 17]).   I want them to be added automatically in the "Recipients" field of the wizard. And, the mail will be sent to all of them.

But, I got this error :

  email_values={'email_to': user.email})
AttributeError: 'int' object has no attribute 'email'


Any help please??

My code :

for user in partners:
            mail_template.send_mail(self.id, force_send=True,
            raise_exception=True,
            email_values={'email_to': user.email})

Avatar
Annuleer
Beste antwoord

Hi,

It seems the user variable holds the record id not a record itself, so you have to get the record-set first in-order to get the email,


user_email = self.env['res.users'].browse(user).email


Thanks

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
feb. 25
3503
0
mei 24
46
1
apr. 24
3330
4
sep. 23
4818
2
sep. 23
7032