Skip to content

Instantly share code, notes, and snippets.

@pschyska
Created December 6, 2010 14:21
Show Gist options
  • Save pschyska/730338 to your computer and use it in GitHub Desktop.
Save pschyska/730338 to your computer and use it in GitHub Desktop.
this.on('componentload', function (instance) {
switch (instance.name) {
case "email":
this.email.on("addrecipients", function(parameters){
console.info("addrecipients event parameters:", parameters);
console.info("this:", this);
this.addRecipients(parameters);
});
this.email.on('sendmessage', function(message_id){
this.sendMessage({message_id: message_id});
}, this);
this.email.on('addlist', function(selection){
console.info('selection:', selection);
this.addListMember({
mailing_list_id: selection.selections.keys[0],
message_id: this.messageId
})
}, this);
break;
case "letter":
this.letter.on("addrecipients", function(parameters){
console.info("addrecipients event parameters:", parameters);
console.info("this:", this);
this.addRecipients(parameters);
}, this);
break;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment