Send email message with PGP inline not PGP/MIME

* Use OpenPGP.js directly instead of nodemailer-openpgp plugin
* Use native ES6 string templates instead of nodemailer template engine
This commit is contained in:
Tankred Hase
2017-08-19 17:06:36 +08:00
committed by Martin Hauck
parent 656aa9b6ed
commit 6ec72aef06
6 changed files with 57 additions and 64 deletions

13
src/email/templates.js Normal file
View File

@@ -0,0 +1,13 @@
'use strict';
exports.verifyKey = ({name, baseUrl, keyId, nonce}) => ({
subject: `Verify Your Key`,
text: `Hello ${name},\n\nplease click here to verify your key:\n\n${baseUrl}/api/v1/key?op=verify&keyId=${keyId}&nonce=${nonce}`,
html: `<p>Hello ${name},</p><p>please <a href=\"${baseUrl}/api/v1/key?op=verify&keyId=${keyId}&nonce=${nonce}\">click here to verify</a> your key.</p>`
});
exports.verifyRemove = ({name, baseUrl, keyId, nonce}) => ({
subject: `Verify Key Removal`,
text: `Hello ${name},\n\nplease click here to verify the removal of your key:\n\n${baseUrl}/api/v1/key?op=verifyRemove&keyId=${keyId}&nonce=${nonce}`,
html: `<p>Hello ${name},</p><p>please <a href=\"${baseUrl}/api/v1/key?op=verifyRemove&keyId=${keyId}&nonce=${nonce}\">click here to verify</a> the removal of your key.</p>`
});