Add upload, update and removal for single user IDs (emails)

This commit is contained in:
Martin Hauck
2019-02-14 18:11:37 +01:00
parent 1651571d36
commit 02adaad939
9 changed files with 274 additions and 95 deletions

View File

@@ -56,15 +56,15 @@ class Email {
* @param {Object} origin origin of the server
* @yield {Object} reponse object containing SMTP info
*/
async send({template, userId, keyId, origin}) {
async send({template, userId, keyId, origin, publicKeyArmored}) {
const compiled = template({
name: userId.name,
baseUrl: util.url(origin),
keyId,
nonce: userId.nonce
});
if (this._usePGPEncryption && userId.publicKeyArmored) {
compiled.text = await this._pgpEncrypt(compiled.text, userId.publicKeyArmored);
if (this._usePGPEncryption && publicKeyArmored) {
compiled.text = await this._pgpEncrypt(compiled.text, publicKeyArmored);
}
const sendOptions = {
from: {name: this._sender.name, address: this._sender.email},