nodebb-plugin-simple-contact 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library.js +12 -10
- package/package.json +1 -1
- package/public/templates/admin/plugins/contact.tpl +2 -2
package/library.js
CHANGED
|
@@ -216,9 +216,6 @@ async function renderAdminPage(req, res) {
|
|
|
216
216
|
async function markAsHandled(req, res) {
|
|
217
217
|
try { await db.setObjectField('contact-request:' + req.body.id, 'handled', true); res.json({ success: true }); } catch (err) { res.status(500).json({ error: err.message }); }
|
|
218
218
|
}
|
|
219
|
-
async function deleteRequest(req, res) {
|
|
220
|
-
try { await db.delete('contact-request:' + req.body.id); await db.sortedSetRemove('contact-requests:sorted', req.body.id); res.json({ success: true }); } catch (err) { res.status(500).json({ error: err.message }); }
|
|
221
|
-
}
|
|
222
219
|
|
|
223
220
|
async function replyToContact(req, res) {
|
|
224
221
|
const { email, subject, content, original_id } = req.body;
|
|
@@ -228,17 +225,22 @@ async function replyToContact(req, res) {
|
|
|
228
225
|
}
|
|
229
226
|
|
|
230
227
|
try {
|
|
231
|
-
|
|
228
|
+
let htmlContent = content.replace(/\n/g, '<br>');
|
|
229
|
+
|
|
230
|
+
htmlContent = `<div dir="rtl" style="direction: rtl; text-align: right; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.5;">
|
|
231
|
+
${htmlContent}
|
|
232
|
+
</div>`;
|
|
232
233
|
|
|
233
234
|
await emailer.sendToEmail('notification', email, 'he', {
|
|
234
235
|
subject: subject || 'תשובה לפנייתך בצור קשר',
|
|
235
|
-
|
|
236
|
+
|
|
237
|
+
username: ' ',
|
|
236
238
|
|
|
237
239
|
notification: {
|
|
238
240
|
type: 'contact-reply',
|
|
239
241
|
bodyShort: subject || 'תשובה לפנייה',
|
|
240
|
-
bodyLong: htmlContent,
|
|
241
|
-
path:
|
|
242
|
+
bodyLong: htmlContent,
|
|
243
|
+
path: null
|
|
242
244
|
},
|
|
243
245
|
|
|
244
246
|
body: htmlContent,
|
|
@@ -246,9 +248,9 @@ async function replyToContact(req, res) {
|
|
|
246
248
|
intro: 'קיבלת תשובה חדשה לפנייתך:'
|
|
247
249
|
});
|
|
248
250
|
|
|
249
|
-
if (original_id) {
|
|
250
|
-
|
|
251
|
-
}
|
|
251
|
+
//if (original_id) {
|
|
252
|
+
// await db.setObjectField('contact-request:' + original_id, 'handled', true);
|
|
253
|
+
//}
|
|
252
254
|
|
|
253
255
|
res.json({ success: true });
|
|
254
256
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -321,8 +321,8 @@
|
|
|
321
321
|
})
|
|
322
322
|
.done(function(data) {
|
|
323
323
|
$('#emailReplyModal').modal('hide');
|
|
324
|
-
showMessage('success', 'המייל נשלח בהצלחה
|
|
325
|
-
setTimeout(function() { ajaxify.refresh(); }, 1000);
|
|
324
|
+
showMessage('success', 'המייל נשלח בהצלחה');
|
|
325
|
+
//setTimeout(function() { ajaxify.refresh(); }, 1000);
|
|
326
326
|
})
|
|
327
327
|
.fail(function(xhr) {
|
|
328
328
|
var err = xhr.responseJSON ? xhr.responseJSON.error : 'שגיאה בשליחה';
|