First step complete

This commit is contained in:
Jonathan Labreuille
2015-09-30 15:56:13 +02:00
parent 2e3b565e8a
commit 45dccf6c50
5 changed files with 48 additions and 15 deletions

View File

@@ -42,7 +42,22 @@ define(
}.bind(this));
},
handleSelectTemplate: function(template) {
console.log('select '+template.id);
MailPoet.Ajax.post({
endpoint: 'newsletters',
action: 'create',
data: {
type: this.props.params.type,
template: template.id
}
}).done(function(response) {
if(response['url'] !== undefined) {
window.location = response['url'];
} else {
response.map(function(error) {
MailPoet.Notice.error(error);
});
}
}.bind(this));
},
handlePreviewTemplate: function(template) {
console.log('preview '+template.id);