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-04-03 16:06:55 -04:00
|
|
|
sendTestEmailDisabled: function() {
|
2013-02-22 15:41:12 -05:00
|
|
|
return this.blank('testEmailAddress');
|
2013-04-03 16:06:55 -04:00
|
|
|
}.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() {
|
2013-04-03 16:06:55 -04:00
|
|
|
this.set('sentTestEmail', false);
|
|
|
|
|
|
|
|
var adminEmailLogsController = this;
|
2013-04-01 16:28:26 -04:00
|
|
|
Discourse.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',
|
2013-04-03 16:06:55 -04:00
|
|
|
data: { email_address: this.get('testEmailAddress') }
|
|
|
|
}).then(function () {
|
|
|
|
adminEmailLogsController.set('sentTestEmail', true);
|
2013-02-22 15:41:12 -05:00
|
|
|
});
|
2013-04-03 16:06:55 -04:00
|
|
|
|
2013-02-22 15:41:12 -05:00
|
|
|
}
|
2013-03-05 15:39:21 -05:00
|
|
|
|
2013-02-22 15:41:12 -05:00
|
|
|
});
|