Skip to content

Commit c32f666

Browse files
committed
Added new methods: MailMessage.high(), MailMessage.low() and MailMessage.confidential()
1 parent 3ab1983 commit c32f666

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

changes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
- added: `RESTBuilder.patch([data])`
66
- added: `CONVERT(obj, schema)` for quick converting values like Schema (more in docs.)
77
- added: `Capitalize2` schema type which converts only the first char
8+
- added: `MailMessage.high()` sets `high` priority of the email messsage
9+
- added: `MailMessage.low()` sets `low` priority of the email messsage
10+
- added: `MailMessage.confidential()` sets `Sensitivity` header with `confidential` value
811

912
- updated: `GROUP()` by adding a new argument `url_prefix`
1013

mail.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,21 @@ Message.prototype.from = function(address, name) {
182182
return this;
183183
};
184184

185+
Message.prototype.high = function() {
186+
this.$priority = 1;
187+
return this;
188+
};
189+
190+
Message.prototype.low = function() {
191+
this.$priority = 5;
192+
return this;
193+
};
194+
195+
Message.prototype.confidential = function() {
196+
this.$confidential = true;
197+
return this;
198+
};
199+
185200
Message.prototype.to = function(address, name, clear) {
186201

187202
if (typeof(name) === 'boolean') {
@@ -537,6 +552,10 @@ Mailer.prototype.$writemessage = function(obj, buffer) {
537552
buffer.push('MAIL FROM: <' + msg.addressFrom.address + '>');
538553
message.push('Message-ID: <total' + (INDEXATTACHMENT++) + '@WIN-t' + (INDEXATTACHMENT) + '>');
539554
message.push('MIME-Version: 1.0');
555+
556+
self.$priority && message.push('X-Priority: ' + self.$priority);
557+
self.$confidential && message.push('Sensitivity: Company-Confidential');
558+
540559
message.push('From: ' + (msg.addressFrom.name ? unicode_encode(msg.addressFrom.name) + ' <' + msg.addressFrom.address + '>' : msg.addressFrom.address));
541560

542561
var length;

0 commit comments

Comments
 (0)