Feedback button

This commit is contained in:
vjrj 2018-02-18 17:00:54 +01:00
parent 5c7380a199
commit ba32c4fd0d
7 changed files with 238 additions and 3 deletions

View file

@ -0,0 +1,25 @@
/* eslint-disable prefer-arrow-callback */
/* eslint-disable import/no-absolute-path */
import { Meteor } from 'meteor/meteor';
import i18n from 'i18next';
import { check } from 'meteor/check';
import sendEmail from '/imports/startup/server/email';
Meteor.methods({
'send-feedback': function sendFeedback(email, feedback) {
check(email, String);
check(feedback, String);
const appName = i18n.t('AppName');
sendEmail({
to: 'info@comunes.org',
from: `${appName} <noreply@comunes.org>`,
subject: `Feedback de ${email}!`,
sendAt: new Date(),
text: `Feedback de ${email}\n\n${feedback}`,
html: `<p>${feedback}</p>`,
template: '<body>{{appName}}<h2>{{{subject}}}</h2>{{{html}}}</body>',
appName
}, true);
}
});

View file

@ -12,3 +12,4 @@ import '../common/comments';
import './sitemaps';
import './subsUnion';
import './prerender';
import './feedback';