Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include links in e-mail notifications #111

Closed
efg opened this issue Sep 24, 2011 · 7 comments · Fixed by #2274
Closed

Include links in e-mail notifications #111

efg opened this issue Sep 24, 2011 · 7 comments · Fixed by #2274

Comments

@efg
Copy link
Member

efg commented Sep 24, 2011

E-mail notifications from Expertiza say what needs to be done, but don't give the recipient much help in knowing where to turn.

  • E-mails about reviews should direct the user to the page where the review is found.
  • Deadline reminders should include a link on where to go to perform the needed function.
  • Instructor notifications of where reviews disagree by more than a threshold # of points should point the instructor to the reviews that disagree.

The task list collects together some of these page addresses; could they be included in e-mail? This might require a way to be directed to a particular Expertiza page when one logs in.

This includes issues #33 and #34.

@nilbus
Copy link
Member

nilbus commented Sep 24, 2011

When following this link, users who are not logged in should be redirected to the login page with a session token or parameter that stores the page to return to. After logging in, they should be redirected to that page. Authlogic likely already has functionality to help with this.

@nilbus
Copy link
Member

nilbus commented Oct 21, 2011

It looks like you'll be working mostly with the email method in models/assignment.rb. I searched the project and as far as I can see, that's only called in one place - controllers/submitted_content_controller:80 in submit_file.

@sgpai
Copy link

sgpai commented Oct 22, 2011

I am trying to understand how and in which cases does an email get generated. So one of the cases is creation of a new user. I am able to roughly understand the flow, and how finally the partial is picked for a specific scenario.

I understand that to send an email you need to call the function defined in mailer.rb.

Consider a case where I am trying to analyze how review process works. I have an email with the subject "A new submission is available for Backchannel "Live Question" application.

  1. I see which partial matches it. Its _update. So the partial_name is update.
  2. Now I do a project wide search for partial name "update" and I get to "assignment.rb" and there is this function "email".

The point I am stuck is that I do not know how and from where this function get called. From what I understand of CR #111, I think if I would understand the above part, I would be able to pass an extra parameter for the URL where the user needs to be redirected.

I hope I am clear enough!
Waiting for a suggestion.

Thanks,
Sarvesh G Pai

@nilbus
Copy link
Member

nilbus commented Oct 22, 2011

mailer.rb is a subclass of ActionMailer::Base. Check out the ActionMailer docs at http://apidock.com/rails/v2.3.8/ActionMailer/Base. The documentation describes how it works in detail, but I'll try to summarize.

SubmittedContentController#submit_file calls assignment.email at submitted_content_controller.rb:80
Assignment#email calls Mailer.deliver_message at assignment.rb:411 and sends :partial => "update" as an option.
ActionMailer has some metaprogramming magic that calls Mailer#message with the intent to deliver the message (as opposed to just creating or storing a message).
Mailer#message sets instance variables that will be used in the update partial, just like a controller sets instance variables to be available to views. There are two update partials - one to generate the text part and one to generate the html part. The partial then gets rendered, just like a view, but it's an email. :-)

@sgpai
Copy link

sgpai commented Oct 29, 2011

We have covered point 2 of the CR.
Coming to point 1 which is about reviews. How do we go about this?

What do we do on the expertiza UI so that when we run the rake task (send_email_reminders), we receive a mail regarding the review? This will help us to find an entrypoint into the case.

Thanks.

@ghost
Copy link

ghost commented May 17, 2013

Check E729.

@ghost ghost closed this as completed May 17, 2013
@ghost ghost reopened this May 17, 2013
@efg efg modified the milestones: Priority 4, Priority 3 Jun 16, 2017
@efg
Copy link
Member Author

efg commented Jun 13, 2018

The third issue (instructor notifications of disagreeing reviews) is fixed, but the other two remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants