nodebb-plugin-simple-contact 2.1.2 → 2.1.4

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 CHANGED
@@ -6,6 +6,7 @@ const groups = require.main.require('./src/groups');
6
6
  const socketIndex = require.main.require('./src/socket.io/index');
7
7
  const emailer = require.main.require('./src/emailer');
8
8
  const user = require.main.require('./src/user');
9
+ const meta = require.main.require('./src/meta');
9
10
 
10
11
  let chats = null;
11
12
  let messaging = null;
@@ -48,7 +49,7 @@ async function getChatRoom(req, res) {
48
49
  try {
49
50
  let roomId = null;
50
51
 
51
- const chatModule = chats || messaging; // עדיפות ל-chats ליצירת חדר
52
+ const chatModule = chats || messaging;
52
53
 
53
54
  if (chatModule.getRoomId) {
54
55
  roomId = await chatModule.getRoomId(myUid, touid);
@@ -221,30 +222,26 @@ async function deleteRequest(req, res) {
221
222
  }
222
223
 
223
224
  async function replyToContact(req, res) {
224
- const { email, subject, content, original_id } = req.body;
225
+ const { email, subject, content } = req.body;
225
226
 
226
227
  if (!email || !content) {
227
228
  return res.status(400).json({ error: 'חסרים נתונים לשליחה' });
228
229
  }
229
230
 
230
231
  try {
231
- const rawHtml = content.replace(/\n/g, '<br>');
232
- const htmlContent = '<div dir="rtl" style="direction: rtl; text-align: right; font-family: Arial, sans-serif;">' + rawHtml + '</div>';
232
+ const htmlBody = content.replace(/\n/g, '<br>');
233
+
234
+ const siteTitle = meta.config['title'] || 'NetFree';
235
+ const logo = meta.config['brand:emailLogo'] || meta.config['brand:logo'];
233
236
 
234
- await emailer.sendToEmail('notification', email, 'he', {
237
+ await emailer.sendToEmail('contact-reply', email, 'he', {
235
238
  subject: subject || 'תשובה לפנייתך בצור קשר',
236
- username: ' ',
239
+ body: htmlBody,
237
240
 
238
- notification: {
239
- type: 'contact-reply',
240
- bodyShort: subject || 'תשובה לפנייה',
241
- bodyLong: htmlContent,
242
- path: null
243
- },
244
-
245
- body: htmlContent,
246
- message: htmlContent,
247
- intro: 'קיבלת תשובה חדשה לפנייתך:'
241
+ site_title: siteTitle,
242
+ url: meta.config['url'],
243
+ "brand:logo": meta.config['brand:logo'],
244
+ "brand:emailLogo": meta.config['brand:emailLogo']
248
245
  });
249
246
 
250
247
  res.json({ success: true });
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "nodebb-plugin-simple-contact",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "תוסף טופס צור קשר עם התראות למנהלים וניהול פניות",
5
5
  "main": "library.js",
6
+ "templates": "templates",
6
7
  "nbbpm": {
7
8
  "compatibility": "^3.0.0"
8
9
  },
@@ -0,0 +1,25 @@
1
+ <div dir="rtl" style="font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; direction: rtl; text-align: right; background-color: #f9f9f9; padding: 20px;">
2
+
3
+ <div style="text-align: center; margin-bottom: 30px;">
4
+ <img src="{url}{brand:emailLogo}" alt="{site_title}" style="max-height: 60px; border: 0;">
5
+ <img src="{url}{brand:logo}" alt="{site_title}" style="max-height: 60px; border: 0;">
6
+ <h1 style="color: #333;">{site_title}</h1>
7
+ </div>
8
+
9
+ <div style="background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 30px; max-width: 600px; margin: 0 auto; box-shadow: 0 2px 4px rgba(0,0,0,0.05);">
10
+
11
+ <h2 style="margin-top: 0; color: #333; font-size: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px;">
12
+ שלום, קיבלנו את פנייתך,
13
+ </h2>
14
+
15
+ <div style="font-size: 16px; color: #444; line-height: 1.6; margin-top: 20px;">
16
+ {body}
17
+ </div>
18
+
19
+ </div>
20
+
21
+ <div style="text-align: center; margin-top: 20px; font-size: 12px; color: #999;">
22
+ הודעה זו נשלחה אוטומטית מאתר <a href="{url}" style="color: #666; text-decoration: none;">{site_title}</a>
23
+ </div>
24
+
25
+ </div>