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

how we can have Odoo send an email notification of when an activity has come to its due date. For right now this is needed in CRM app, for the activities on Opportunities.

 

The notification should go to the person assigned to the activity. As you can see below, I have a To Do on the below opportunity due today, I would like that Odoo sends me an email telling me I have this To Do today.

I have tried it with automated actions but its not triggering. Please advice me on how to get it working or if I could try it another way. 

New to Odoo - Thank you in advance.

Imagine profil
Abandonează
Autor Cel mai bun răspuns

Creyox Technologies - Thank you so much! I will try this.

This code below is working when I run it manually but my scheduled action is not triggering automatically. scheduler user is set to me but for rest of the scheduled actions its OdooBot. Why am I facing this issue and how to solve this?


Im using odoo 15 on odoosh which we moved recently, below is the minified code. I dont have access to github and all as im new to this at my office


Code: template = env['mail.template'].search([('name', '=', 'Test - Due date reminder for CRM Activity')], limit=1);

if not template.exists(): raise UserError("Template 'Test - Due date reminder for CRM Activity' not found!");

activities = env['mail.activity'].search([('res_model', '=', 'crm.lead'), ('date_deadline', '=', datetime.date.today()), ('user_id', '!=', False)]);

log_messages = [];

[log_messages.append(f"Preparing email for activity: {activity.id} User: {activity.user_id.name}") or (email_content := f"<p>Dear {activity.user_id.name},</p><p>This is a reminder that you have an activity due today.</p><p>Opportunity: {activity.res_name}</p><p>Activity Type: {activity.activity_type_id.name}</p><p>Due Date: {activity.date_deadline}</p><p>Activity Subject: {activity.summary}</p><p>Description: {activity.note or 'No additional notes.'}</p><p>Thank you!</p>", email_subject := f"Reminder: You have an activity due today for {activity.activity_type_id.name}", email := env['mail.mail'].create({'subject': email_subject, 'body_html': email_content, 'email_to': activity.user_id.email, 'auto_delete': False}), email.send(), log_messages.append(f"Email sent to: {email.email_to} for activity: {activity.id}") if not log_messages else None) for activity in activities];

if log_messages: raise UserError("\n".join(log_messages))


Imagine profil
Abandonează
Cel mai bun răspuns

Hello Prasath,

You can set up a scheduled action to notify users via email about upcoming activity due dates.

Thanks,
info@creyox.com

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
dec. 24
1208
2
iul. 24
2260
1
mai 24
2677
0
dec. 15
3475
0
iun. 25
7019