Skip to content
Snippets Groups Projects
Commit 45ffab08 authored by std-odoo's avatar std-odoo
Browse files

[FIX] website_event_track: fix new track notifications by email


Bug
===
1. Create an event which allows track proposal
2. Follow it and subscribe to "New Track"
3. Log in in incognito and submit a proposal

The email is not sent, because it's sent as the public user, which has
no email address set. And so it the 2 system parameters
<mail.catchall.domain> and <mail.default.from> are not set, we can not
know which email address used to send the email.

Note that this bug also occurs if you create a track with a user without
an email address set.

Task 2510181

closes odoo/odoo#69890

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 7c0da92c
No related branches found
No related tags found
No related merge requests found
......@@ -322,11 +322,13 @@ class Track(models.Model):
tracks = super(Track, self).create(vals_list)
for track in tracks:
email_values = {} if self.env.user.email else {'email_from': self.env.company.catchall_formatted}
track.event_id.message_post_with_view(
'website_event_track.event_track_template_new',
values={'track': track},
subject=track.name,
subtype_id=self.env.ref('website_event_track.mt_event_track').id,
**email_values,
)
track._synchronize_with_stage(track.stage_id)
......
......@@ -284,7 +284,7 @@ class IrMailServer(models.Model):
"""
email_from = email_from or self._get_default_from_address()
assert email_from, "You must either provide a sender address explicitly or configure "\
"using the combintion of `mail.catchall.domain` and `mail.default.from` "\
"using the combination of `mail.catchall.domain` and `mail.default.from` "\
"ICPs, in the server configuration file or with the "\
"--email-from startup parameter."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment