Project

General

Profile

« Previous | Next » 

Revision 3a36bdf6

Added by Stephen Benjamin over 9 years ago

fixes #7586, #7734, #7172 - user preferences for receiving mail notifications

Adds a framework for user-selectable mail notifications. The work is
still done in ActionMailer classes and launch by rake in cron, however a
wrapper called MailNotification is used to provide RBAC and make the
association with users.

Plugins may seed their own mail notifications, see
db/seeds.d/16-mail-notifications.rb for an example.

Authors:
Shlomi Zadok <>
Stephen Benjamin <>

View differences:

app/views/users/_form.html.erb
<ul class='nav nav-tabs' data-tabs='tabs'>
<li class='active'><a href='#primary' data-toggle='tab'><%= _('User') %></a></li>
<li><a href='#mail_preferences' data-toggle='tab'><%= _('Mail Preferences') %></a></li>
<% if show_location_tab? %>
<li><a href='#locations' data-toggle='tab'><%= _('Locations') %></a></li>
<% end %>
......
</div>
</div>
<div class='tab-pane' id='mail_preferences'>
<%= field_set_tag _("General") do %>
<%= checkbox_f f, :mail_enabled %>
<% end %>
<% if @user.new_record? %>
<div class="alert alert-block alert-warning">
<p><strong><%= _("Notice") %></strong> <%= _("Please save the user first before assigning mail notifications.") %></p>
</div>
<% else %>
<%= field_set_tag _("Notifications") do %>
<%= f.fields_for :user_mail_notifications do |mail_form| %>
<%= render :partial => "users/mail_notifications", :locals => { :f => mail_form } %>
<% end %>
<% end %>
<% end %>
</div>
<div class='tab-pane' id='roles'>
<%= checkbox_f f, :admin if User.current.can_change_admin_flag? %>
<%= multiple_checkboxes f, :roles, @user, Role.givable.for_current_user,

Also available in: Unified diff