create a wrapper class for devise mailer, both so we can resquify it and so we can inject helpers
This commit is contained in:
parent
e4062bf5fd
commit
bb5ada6533
3 changed files with 10 additions and 11 deletions
5
app/mailers/diaspora_devise_mailer.rb
Normal file
5
app/mailers/diaspora_devise_mailer.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class DiasporaDeviseMailer < DeviseMailer
|
||||
include NotifierHelper
|
||||
default :from => AppConfig[:smtp_sender_address]
|
||||
|
||||
end
|
||||
|
|
@ -15,21 +15,14 @@ end
|
|||
|
||||
Devise.setup do |config|
|
||||
# Configure the e-mail address which will be shown in DeviseMailer.
|
||||
if AppConfig[:smtp_sender_address]
|
||||
config.mailer_sender = AppConfig[:smtp_sender_address]
|
||||
else
|
||||
unless Rails.env == 'test'
|
||||
Rails.logger.warn("No smtp sender address set, mail may fail.")
|
||||
puts "WARNING: No smtp sender address set, mail may fail."
|
||||
end
|
||||
config.mailer_sender = "please-change-me@config-initializers-devise.com"
|
||||
end
|
||||
|
||||
# ==> ORM configuration
|
||||
# Load and configure the ORM. Supports :active_record (default), :mongoid
|
||||
# (bson_ext recommended) and :data_mapper (experimental).
|
||||
require 'devise/orm/active_record'
|
||||
|
||||
# Configure the class responsible to send e-mails.
|
||||
config.mailer = "DiasporaDeviseMailer"
|
||||
|
||||
# ==> Configuration for any authentication mechanism
|
||||
# Configure which keys are used when authenticating an user. By default is
|
||||
# just :email. You can configure it to use [:username, :subdomain], so for
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
var ContactEdit = {
|
||||
init: function(){
|
||||
$.extend(ContactEdit, AspectsDropdown);
|
||||
$('.dropdown.aspect_membership .dropdown_list > li').live('click', function(evt){
|
||||
$('.dropdown.aspect_membership .dropdown_list > li, .dropdown.inviter .dropdown_list >li').live('click', function(evt){
|
||||
ContactEdit.processClick($(this), evt);
|
||||
});
|
||||
// $('.button.resend').live('click', function(evt){
|
||||
|
|
@ -23,6 +23,7 @@ var ContactEdit = {
|
|||
li.addClass('loading');
|
||||
if (dropdown.hasClass('inviter')) {
|
||||
ContactEdit.inviteFriend(li, evt);
|
||||
dropdown.html('sending, please wait...');
|
||||
}
|
||||
else {
|
||||
ContactEdit.toggleAspectMembership(li, evt);
|
||||
|
|
|
|||
Loading…
Reference in a new issue