Skip to content

Commit

Permalink
Add "Add to CC" functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
lamby committed Nov 22, 2018
1 parent 161c7e5 commit 3177f5f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions js/main.js
Expand Up @@ -163,6 +163,31 @@ function FastMailEnhancementSuite(options) {
$.setSubject(subject + " (was: \"" + $.getSubject() + "\")");
}
});

wrapper
.find('a:first')
.clone()
.text("Add to CC")
.prependTo(wrapper)
.on('click', function() {
var instance = FastMail.mail.screens.compose.instance;

var email = prompt("Enter address to add to CC");

if (email == null) {
return;
}

var cc = (instance.get('cc') + ', ' + email).replace(/^, /, '');
var body = '[Adding ' + email + ' to CC]\n\n' + instance.get('plainBody');

instance
.beginPropertyChanges()
.set('cc', cc)
.set('plainBody', body)
.endPropertyChanges()
;
});
}, 500);
});

Expand Down

0 comments on commit 3177f5f

Please sign in to comment.