Hi
Please, how can i use property force_send=True in the model mail.mail in send()
Hi
Please, how can i use property force_send=True in the model mail.mail in send()
Hiii, asmaa
Like this, you add force_send=True
def action_post(self):
res = super(AccountMove, self).action_post()
template = self.env.ref('your template id')
for rec in self:
if rec.partner_id.email:
template.send_mail(rec.id, force_send=True)
return res
Hi asmaa,
You can use force_send parameter in the send_mail method of the mail.template model not in the mail.mail.
Template will create a mail and schedule it for the next execution. if you pass force_send=True, then the mail will execute instantly and no schedule will added.
sale_order_template_id.send_mail(record_id, force_send=True)
For send method of the mail.mail, it will execute and send the mail directly if you have not added the schedule_date in it.
Hope it will help you.
Creează-ți un cont astăzi pentru a beneficia de funcții exclusive și a interacționa cu minunata noastră comunitate!
Înscrie-te| Postări similare | Răspunsuri | Vizualizări | Activitate | |
|---|---|---|---|---|
|
2
oct. 24
|
6234 | |||
|
1
apr. 23
|
5792 | |||
|
0
iun. 22
|
4212 | |||
|
0
mar. 26
|
16 | |||
|
Timesheet App in backoffice
Rezolvat
|
2
mar. 26
|
3543 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.