Saurang Suthar(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-calendar-hmo-p1--meeting_reminder_alarm-ssu
into lp:~openerp-dev/openobject-addons/trunk-calendar-hmo-p1-.
Requested reviews:
Jigar Amin (OpenERP) (jam-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-calendar-hmo-p1--meeting_reminder_alarm-ssu/+merge/86900
Hello sir,
I have improved the email is to be sent to the specific user.
Thank you.
SSU
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-calendar-hmo-p1--meeting_reminder_alarm-ssu/+merge/86900
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-calendar-hmo-p1-.
=== modified file 'base_calendar/calendar_alarm.py'
--- base_calendar/calendar_alarm.py 2011-08-04 12:58:47 +0000
+++ base_calendar/calendar_alarm.py 2011-12-26 13:08:29 +0000
@@ -132,7 +132,7 @@
request_obj = self.pool.get('res.request')
alarm = self.browse(cr, uid, alarm_id, context=context)
event = alarm.event_id
-
+ mail_message = self.pool.get('mail.message')
if alarm.action == 'internal':
value = {
'name': event.name,
@@ -146,17 +146,20 @@
if alarm.action == 'email':
- sub = '[Reminder] %s' % (event.name)
+ subject = '[Reminder] %s' % (event.name)
body = event.description
- mail_to = [event.user_id.address_id.email]
-
- if mail_to:
- tools.email_send(
- tools.config.get('email_from', False),
- mail_to,
- sub,
- body
- )
+ mail_to = [event.user_id.user_email]
+ mail_from = event.organizer_id and event.organizer_id.user_email or False
+ if mail_to and mail_from:
+ mail_message.schedule_with_attach(cr, uid,
+ mail_from,
+ mail_to,
+ subject,
+ body,
+ model='calendar.event',
+ res_id=event.id,
+ context=context
+ )
self.unregister_cron(cr, uid, [alarm.id], context)
return True
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp