Permalink
Browse files

Add "Add to CC" functionality.

  • Loading branch information...
lamby committed Nov 22, 2018
1 parent 161c7e5 commit 3177f5f64efc8e192bb4d9ff6ebacb07999ec57e
Showing with 25 additions and 0 deletions.
  1. +25 −0 js/main.js
@@ -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);
});

0 comments on commit 3177f5f

Please sign in to comment.