https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292009-02-06T15:55:23ZRedmineRedmine - Feature #2659: Refactor Mailer delivery methods out of controller and into observershttps://www.redmine.org/issues/2659?journal_id=71732009-02-06T15:55:23ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul>Before doing the refactoring, here are a few thoughts:
<ul>
<li>how to do a single notification when several objects are added/updated (just how it occurs today when adding several files at the same time)? A notification should be also added when bulk editing issues. Sending a notification for each modified issue would be insane and pretty slow.</li>
<li>maybe one day, we'd like to display the name of the users that were notified (eg. in the flash message). How to retrieve it from the observer?</li>
</ul> Redmine - Feature #2659: Refactor Mailer delivery methods out of controller and into observershttps://www.redmine.org/issues/2659?journal_id=72232009-02-10T00:06:39ZEric Davis
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
Before doing the refactoring, here are a few thoughts:
<ul>
<li>how to do a single notification when several objects are added/updated (just how it occurs today when adding several files at the same time)?</li>
</ul>
</blockquote>
<p>I'll watch out for those. My main concern is the issue notifications. The <code>add_files</code> action isn't very complex so it won't need refactoring right now.</p>
<blockquote>
<p>A notification should be also added when bulk editing issues. Sending a notification for each modified issue would be insane and pretty slow.</p>
</blockquote>
<p>Bulk edits already send one email per issue:</p>
<pre><code class="ruby syntaxhl"><span class="c1"># app/controllers/issues_controller.rb L252</span>
<span class="no">Mailer</span><span class="p">.</span><span class="nf">deliver_issue_edit</span><span class="p">(</span><span class="n">journal</span><span class="p">)</span> <span class="k">if</span> <span class="n">journal</span><span class="p">.</span><span class="nf">details</span><span class="p">.</span><span class="nf">any?</span> <span class="o">&&</span> <span class="no">Setting</span><span class="p">.</span><span class="nf">notified_events</span><span class="p">.</span><span class="nf">include?</span><span class="p">(</span><span class="s1">'issue_updated'</span><span class="p">)</span>
</code></pre>
<blockquote>
<ul>
<li>maybe one day, we'd like to display the name of the users that were notified (eg. in the flash message). How to retrieve it from the observer?</li>
</ul>
</blockquote>
<p>Would that be the responsibility of the Observer, the Mailer, or the Controller though?</p> Redmine - Feature #2659: Refactor Mailer delivery methods out of controller and into observershttps://www.redmine.org/issues/2659?journal_id=82792009-03-28T00:36:33ZEric Davis
<ul><li><strong>Status</strong> changed from <i>7</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>0.8.3</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>I've added some observers to watch model objects for mail delivery instead of calling <code>Mailer</code> in <a class="changeset" title="Added observers to watch model objects for mail delivery instead of calling Mailer. * Added an I..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/2637">r2637</a>.</p> Redmine - Feature #2659: Refactor Mailer delivery methods out of controller and into observershttps://www.redmine.org/issues/2659?journal_id=84932009-04-05T12:06:30ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li><li><strong>Target version</strong> changed from <i>0.8.3</i> to <i>0.9.0</i></li></ul><p>Thanks, I prefer to keep this refactoring for 0.9.</p>