2013-02-20 13:15:50 -05:00
|
|
|
(function() {
|
|
|
|
|
2013-02-21 12:58:21 -05:00
|
|
|
/**
|
|
|
|
This controller supports the interface for reviewing email logs.
|
|
|
|
|
|
|
|
@class AdminEmailLogsController
|
|
|
|
@extends Ember.ArrayController
|
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
|
|
|
**/
|
2013-02-20 13:15:50 -05:00
|
|
|
window.Discourse.AdminEmailLogsController = Ember.ArrayController.extend(Discourse.Presence, {
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-21 14:42:48 -05:00
|
|
|
/**
|
|
|
|
Is the "send test email" button disabled?
|
|
|
|
|
|
|
|
@property sendTestEmailDisabled
|
|
|
|
**/
|
2013-02-20 13:15:50 -05:00
|
|
|
sendTestEmailDisabled: (function() {
|
|
|
|
return this.blank('testEmailAddress');
|
|
|
|
}).property('testEmailAddress'),
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-21 14:42:48 -05:00
|
|
|
/**
|
|
|
|
Sends a test email to the currently entered email address
|
|
|
|
|
|
|
|
@method sendTestEmail
|
|
|
|
**/
|
2013-02-20 13:15:50 -05:00
|
|
|
sendTestEmail: function() {
|
|
|
|
var _this = this;
|
2013-02-21 12:58:21 -05:00
|
|
|
_this.set('sentTestEmail', false);
|
2013-02-20 13:15:50 -05:00
|
|
|
jQuery.ajax({
|
|
|
|
url: '/admin/email_logs/test',
|
|
|
|
type: 'POST',
|
2013-02-21 12:58:21 -05:00
|
|
|
data: { email_address: this.get('testEmailAddress') },
|
2013-02-20 13:15:50 -05:00
|
|
|
success: function() {
|
|
|
|
return _this.set('sentTestEmail', true);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
}
|
2013-02-21 12:54:40 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
}).call(this);
|