App.Collections.Envelopes = Backbone.Collection.extend({
	model : App.Models.Envelope,
	url: App.baseUrl + '/inbox/envelope'
	
	/*
	url: function(){
		return App.baseUrl + '/api/mail/send'
	}
	*/
});

App.Collections.Envelopes.prototype.saveDrafts = function(){
	envs = this.models;
	if(envs.length){
		envs.forEach(function(env,i){
			if( env.validateDraft() ){
				env.set('isDraft',true);
				env.prepare();
				env.save();
			}
		});
	}
}
/*
App.Collections.Envelopes.prototype.setAttachmentsQueryString = function(name,value){
	this.attachments += '&'+name+'='+value;
};

App.Collections.Envelopes.prototype.setBcc = function(bcc){
	this.bcc = bcc;
};

App.Collections.Envelopes.prototype.setBodyText = function(bodyText){
	this.bodyText = bodyText;
};

App.Collections.Envelopes.prototype.setCc = function(cc){
	this.cc = cc;
};

App.Collections.Envelopes.prototype.setSubject = function(subject){
	this.subject = subject;
};

App.Collections.Envelopes.prototype.setEmailTo = function(emailTo){
	this.emailTo = emailTo;
};

*/
