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