Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
1499 Vizualizări

hi im trying to create a send email button but when i click it it doesnt send it immediately i check email menu on technical and emails are in outgoing stage
i have already configured outgoing email 
this is my code:

def action_send_email_qs(self):
​template = self.env.ref("sale_modify.email_template_quote")
​for rec in self:
​if rec.partner_id.email:
​email_values = {'subject': 'Test OM'}
​template.send_mail(rec.id, force_send=True)

help me plz and I will mark your answer as correct!

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

You can try this method.

def action_send_email_qs(self):
​template = self.env.ref('sale_modify.email_template_quote')
​for rec in self:
​if rec.partner_id.email:
​template.send_mail(self.id, force_send=True,
​email_values={
​'email_to': rec.partner_id.email,
​'subject': 'Test OM'
​})

Regards

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iun. 22
3784
1
ian. 22
2293
2
aug. 23
2052
2
mai 23
2218
1
apr. 23
2369