Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
1795 Zobrazení

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.

Avatar
Zrušit
Autor Nejlepší odpověď

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))


Avatar
Zrušit
Nejlepší odpověď

Hello Prasath,

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

Thanks,
info@creyox.com

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
pro 24
1124
2
čvc 24
2160
1
kvě 24
2616
0
pro 15
3416
0
čvn 25
6963