Merge branch 'devel' of https://github.com/VulcanJS/Vulcan into devel

This commit is contained in:
SachaG 2018-02-17 10:58:12 +09:00
commit be65866d25
3 changed files with 9 additions and 4 deletions

View file

@ -52,6 +52,10 @@ const schema = {
}, },
}, },
}, },
'hooks.$': {
type: Object,
}
}; };
export default schema; export default schema;

View file

@ -24,7 +24,7 @@ VulcanEmail.addTemplates = templates => {
}; };
VulcanEmail.getTemplate = templateName => Handlebars.compile( VulcanEmail.getTemplate = templateName => Handlebars.compile(
VulcanEmail.templates[templateName], VulcanEmail.templates[templateName],
{ noEscape: true, strict: true} { noEscape: true, strict: true}
); );
@ -59,7 +59,7 @@ VulcanEmail.generateTextVersion = html => {
}); });
} }
VulcanEmail.send = (to, subject, html, text) => { VulcanEmail.send = (to, subject, html, text, throwErrors) => {
// TODO: limit who can send emails // TODO: limit who can send emails
// TODO: fix this error: Error: getaddrinfo ENOTFOUND // TODO: fix this error: Error: getaddrinfo ENOTFOUND
@ -95,6 +95,7 @@ VulcanEmail.send = (to, subject, html, text) => {
} catch (error) { } catch (error) {
console.log("// error while sending email:"); // eslint-disable-line console.log("// error while sending email:"); // eslint-disable-line
console.log(error); // eslint-disable-line console.log(error); // eslint-disable-line
if (throwErrors) throw error;
} }
} else { } else {

View file

@ -1,5 +1,5 @@
import Users from './collection.js'; import Users from './collection.js';
import CryptoJS from 'crypto-js'; import md5 from 'crypto-js/md5';
Users.avatar = { Users.avatar = {
@ -35,7 +35,7 @@ Users.avatar = {
hash: function (string) { hash: function (string) {
var self = this; var self = this;
// eslint-disable-next-line babel/new-cap // eslint-disable-next-line babel/new-cap
return CryptoJS.MD5(self.cleanString(string)).toString() return md5(self.cleanString(string)).toString()
}, },
/** /**