Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Email notifications support #161

Merged
merged 11 commits into from
Nov 22, 2013
Merged

Email notifications support #161

merged 11 commits into from
Nov 22, 2013

Conversation

FrostyX
Copy link

@FrostyX FrostyX commented Sep 6, 2013

I have added notifications to this few actions:

  • Notify user when creating issue assigned to him
  • Notify user when updating issue assigned to him
  • Notify user when issue is reassigned to him
  • Notify user when someone is commenting issue assigned to him

(sorry for some typo in one of commit messages and next two commits trying to fix it)

@akanevsky
Copy link

I think this is a great feature that should be part of the core project. I would like to adjust a few things (minor bugs and grammar issues) in your fork and then add the result to the real installation that I am using. Can you add me as a collaborator to your fork so I can contribute my patch, or maybe I should fork off of your fork and then send you a pull request?

@FrostyX
Copy link
Author

FrostyX commented Nov 13, 2013

I agree, that functionality really should be part of core project. I am not saying it have to be exactly this implementation, but it is done, so I hope in accepting this request.

I am glad you want to callaborate with me. Lets do it.

@akanevsky
Copy link

There, I added the changes that I wanted to see.
I think that this pull request is now ready for approval.

- Print assigned user
- Print only one time - create or update
- Fix printing "Updated By"
@woolfg
Copy link
Contributor

woolfg commented Nov 20, 2013

Cool feature! - would be glad to see this feature in the main branch

mikelbring added a commit that referenced this pull request Nov 22, 2013
Email notifications support
@mikelbring mikelbring merged commit 8b9e91b into mikelbring:develop Nov 22, 2013
@baurez
Copy link

baurez commented Nov 26, 2013

How we could retrieve the translation for the issue state in the email template ?

ex: closed --> fermé

thx...

@baurez
Copy link

baurez commented Nov 26, 2013

I've do this:
_('tinyissue.label'.$verb)

is this right ??

@woolfg
Copy link
Contributor

woolfg commented Nov 26, 2013

I am currently working on the translations of the email templates....hope, I'll push it next week

@baurez
Copy link

baurez commented Nov 26, 2013

:)

2013/11/26 Wolfgang Gassler [email protected]

I am currently working on the translations of the email templates....hope,
I'll push it next week


Reply to this email directly or view it on GitHubhttps://github.com//pull/161#issuecomment-29296444
.

@baurez
Copy link

baurez commented Nov 27, 2013

What do you think about:

  • Send notification "issue closed" to the creator of the issue ?
  • Send notification "commented" to the creator of the issue ?
  • Add the comment to the mail sended ?

ex: (i'm not sure of what i do... I add this into comment.php after line 69)

    if ($issue->user->id != \Auth::user()->id)
    {
        $project = \Project::current();

        $subject = 'Issue "' . $issue->title . '" in "' . $project->name . '" project has a new comment';
        $text = \View::make('email.commented_issue', array(
            'actor' => \Auth::user()->firstname . ' ' . \Auth::user()->lastname,
            'project' => $project,
            'issue' => $issue,
            'comment' => $input['comment'],
        ));

        \Mail::send_email($text, $issue->user->email, $subject);
    }

@FrostyX
Copy link
Author

FrostyX commented Nov 27, 2013

I think it would be better to everyone has possibility to "watch" an arbitrary issue.

@ryanwinchester
Copy link

So then I should use develop branch if I want email notifications?

I already have master branch v1.3 installed and there are existing issues.

How can I get email notifications working?

@akanevsky
Copy link

I am pretty sure that all you have to do is overwrite your current files with the contents of the develop branch, and then configure SMTP settings in the configuration file. Once you do that, alerts should start going out.

@ryanwinchester
Copy link

Yeah thanks. You were correct. I had to take a closer look at the notification code sections and it (rightly) checks if the user updating the issues is the same one that is assigned, and therefore doesn't send an email if you are the one changing it. That's why I wasn't getting any emails 😆

I created a test user and verified that notification emails are being sent out.

@woolfg
Copy link
Contributor

woolfg commented Feb 10, 2014

added multilang email support in #197

@schonhose
Copy link

I was wondering how hard it would be to email people who have commented on an issue when there has been a new comment?

I also noticed the person who has opened the issue does not get an email when a comment is made.

It would be great if there is a possibility to watch an issue and receive notifications of all activity. Not sure how hard this would to implement, but perhaps someone has been working on this.

@ryanwinchester
Copy link

Yeah it seems that only the person who is assigned to the issue gets notifications. Notification functionality is very lacking.

@schonhose
Copy link

Problem is that while I do know PHP I do not know enough about Laravel to achieve what I would like to do.

There are several solutions, one quick and dirty solution would be when a comment is posted on an issue to get all unique user_ids of previous comments to this issue. From these list of user_ids remove the person who has posted the comment and send all remaining users an email.

To include the creator of the issue the code by baurez can be used. This will send out notifications to all people involved.

However, as mentioned earlier somewhere in either this issue or another issue about notifications, the possibility to watch an issue would be even better because people can subscribe to issues they are not involved in but would like to be updated on the progress.

In order to achieve this I am thinking about a new table, say issue_watch containing an user_id and an issue_id. Based upon updates to a certain issue_id you can select the user_ids who are watching the issue and notify them by email.

UI wise I am thinking about either a simple checkbox or a watch (eye) icon that changes from gray (not watching) to green (watching). Clicking that icon should toggle the state and either add a record to the issue_watch table or remove it (AJAX-call).

In the preferences you can add another option so people who are commenting on an issue are automatically also watching the issue. That way people can disable that if they are not interested in receiving follow-up emails. Needless to say they could still use the watch icon to toggle the watching/notification state.

Now if I only knew enough about the structure of Laravel to actually write this. Without the specific framework code but just plain PHP this would be pretty easy and straightforward.

@akanevsky
Copy link

Currently the following notifications exist:

  • When a new issue is created without an assigned user, all users assigned to the project will receive a notification.
  • When an issue receives an update, the currently assigned person will receive a notification, unless that person is making the update.
  • When a new user is assigned to an issue, that person will receive a notification, unless they assigned themselves.

It is certainly possible to implement a feature that would allow users to watch an issue. The question is, should some or all of the current notifications stay in place, or should this be completely replaced by notifications to people watching an issue?

@schonhose
Copy link

If we have a watch feature in place we could replace the current notifications with the watch feature. I am thinking instead of the current setup we could automatically add users so they watch the issue. E.g.

  • When a new issue is created without an assigned user, all users assigned to the project be watching the issue initially.
  • When an issue receives an update, all users watching should receive an update. If the update is placed by a 'new' user who has not participated earlier that user should be added to the watch list.
  • When a new user is assigned to an issue, that person will be added to the watch list.

In the setup I have in mind we do have to keep track of the users preferences. We could initially add users to the watch list described as above, but we also have to keep a issue based user preference. With this I mean that when a user manually removes himself from the list and makes a comment after that we should not be adding that user to the watch list again.

@ryanwinchester
Copy link

When a new issue is created without an assigned user, all users assigned to the project be watching the issue initially.

I like all of your other suggestions, but I don't think all users in a project should be subscribed to a newly created issue. I think the current notification for that is good. One email letting them know a new issue is created.

@schonhose
Copy link

Well, that works as well. I am still working on understanding Laravel, it has been a slow process. I am no way near implementing this stuff, however I did manage to produce some code that will email people who have been commenting on an issue when a new comment is posted. I have been testing this with a few people and it seems to be working.

@akanevsky
Copy link

I could have used this feature myself, but the truth is that it would really be a much better time investment to rewrite this project from scratch using Laravel 4. It has a much cleaner syntax and a better support for various features. Let alone the fact that it supports newer versions of PHP.

@schonhose
Copy link

There has been a pull request detailing the update to Laravel 4 if my mind serves me correctly.

@FrostyX
Copy link
Author

FrostyX commented Mar 18, 2014

@schonhose: Maybe this pull request #186

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

Successfully merging this pull request may close these issues.

7 participants