snappymail/dev/Model/Identity.js
2022-10-10 13:52:56 +02:00

36 lines
546 B
JavaScript

import { AbstractModel } from 'Knoin/AbstractModel';
export class IdentityModel extends AbstractModel {
/**
* @param {string} id
* @param {string} email
*/
constructor(id, email) {
super();
this.addObservables({
id: id || '',
email: email,
name: '',
replyTo: '',
bcc: '',
signature: '',
signatureInsertBefore: false,
askDelete: false
});
}
/**
* @returns {string}
*/
formattedName() {
const name = this.name(),
email = this.email();
return name ? name + ' <' + email + '>' : email;
}
}