Closed Bug 1245643 Opened 9 years ago Closed 7 years ago

Erroneous mail content when a comment is written on an event

Categories

(Mozilla Reps Graveyard :: reps.mozilla.org, task, P3)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: flore, Assigned: fossbalaji)

Details

(Whiteboard: [mozfr-community])

When a comment is added to an event, the event owner receives an email. The subject is correct, but the content is incorrect. Real case: Subject: "[Event] User Christophe Villeneuve commented on event "Paris Open Source Summit 2015"" Content: "This email was generated automatically to inform you that Flore Allemandou added a comment on the event you are organizing." Problem: the user mentioned in the email body is the event organizer (that would be me, in that case) and not the user who commented. Fortunately, the subject gives the missing information. Expected result: the username in the email body should be the one that commented (or did the action) and not the event owner.
Group: mozilla-reps-admins
Priority: -- → P3
I would like to work on this bug
(In reply to Balaji from comment #1) > I would like to work on this bug Thanks for the interest. Please go ahead :) I assume your setup is still working? If not, feel free to reach out to me.
Hi, Found the issue why it happens. Need few suggestions before changing in multiple places. So email is sent from model signal-> tasks.py (where send email func does that) Reasons: 1) In email template user.get_profile() --- actual user who commented and our model signals pass the correct user 2) In tasks.py (this user --> updated by actual recipent (owner) because of recipent exists check before sending email Solution: 1) change the object instead of user --> (commenter or somereasonable) in email template and pass the value in model signals which won't affect the checks and other updates. 2) After the recipient check we should avoid actual user object overwritten by recipient user object Kindly tell your suggestions .
(In reply to Balaji from comment #3) > Solution: > 1) change the object instead of user --> (commenter or somereasonable) > in email template and pass the value in model signals which won't affect the > checks and other updates. Without knowing that part of the code at all, I had a quick look and I think passing the commenter as a separate object to |ctx_data| in |email_event_owner_on_add_comment| is a good way of solving this. Then the email template can use that instead of the overwritten |user| variable. Great work so far!
Thanks .. I have a made a pull request . https://github.com/mozilla/remo/pull/1419
Assignee: nobody → fossbalaji
Status: NEW → ASSIGNED
Commit pushed to master at https://github.com/mozilla/remo https://github.com/mozilla/remo/commit/767f19b3a9ee20b02f6580a5b28a05085c0c96b2 [fix bug 1245643] Erroneous mail content when a comment is written on… (#1419) * [fix bug 1245643] Erroneous mail content when a comment is written on an event * [fix bug 1245643] user object replaced by commenter
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Product: Mozilla Reps → Mozilla Reps Graveyard
You need to log in before you can comment on or make changes to this bug.