This repository has been archived on 2026-07-19 . You can view files and clone it. You cannot open issues or pull requests or push a commit.
v1.1.0
After reading the NetworkStorageIntegration repo I realized the previous
"save attachments" flow was wrong on every level — Marcus-Law doesn't
use EspoCRM's stock Document/DocumentFolder model. Folders are real
filesystem paths under the network share, named after the Case (format
"<number>-<primary contact name>") with four standard subfolders:
מסמכים, אסמכתאות, התכתבויות, כללי.
Rewire the save pipeline against the integration's real endpoints
(documented in routes.json on the server repo):
Core — three new IEspoCrmClient methods:
- EnsureCaseSubfoldersAsync(caseId)
POST /NetworkStorage/action/createSubfolders
Idempotent — creates case folder + defaults if missing.
- ListNetworkStorageFolderAsync(path)
GET /NetworkStorage/folderContents?path=…
Returns folders + files; we filter to type=folder for the dropdown.
- UploadAttachmentToNetworkStorageAsync(attachmentId, targetPath)
POST /NetworkStorage/action/upload
Moves the staged Attachment binary onto the share at <path>/<name>.
CaseEntity gets a new `networkStorageFolderPath` field (set by the
integration's hook on first Document save; empty until then).
NetworkStorageItem DTO captures the folder-listing rows.
AttachmentSaveService rewritten — no more Document creation, no more
DocumentFolder picker. The new contract is:
SaveAsync(attachments, targetFolderPath)
Where targetFolderPath = "<case folder>[/subfolder]". For each
attachment: upload binary via standard /Attachment, then move via
NetworkStorage upload.
UI — SaveAttachmentsViewModel:
- Subfolder dropdown switched from DocumentFolder objects to strings.
- Static defaults loaded up-front:
"(שורש התיק)" + 4 server-side defaults.
- When the user picks a case:
1) hydrate Case (number + networkStorageFolderPath) via GetCase
2) call EnsureCaseSubfoldersAsync to materialise standard folders
3) listFolder at the case path to merge any custom subfolders into
the dropdown.
- ResolveCaseFolderPath: use Case.networkStorageFolderPath if set,
otherwise compute "<number>-<contact-name>" with a client-side
SanitizeFolderSegment that mirrors LocalFilesystemClient::sanitizeFileName
on the server (geresh/gershayim/quotes removed, illegal chars → hyphen).
AddInHost.LaunchSaveAttachmentsAsync:
- Composes <caseFolder>[/subfolder] from the VM choice.
- Pre-flight ensureCaseSubfolders as a safety net (in case the user
submitted before the dialog's lazy refresh completed).
- Summary MessageBox now shows the resolved storage path instead of a
bare entity name.
Tests: 39 passing. The build is clean across Core / UI / Tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
OutlookAddin — תוסף EspoCRM ל-Outlook Desktop
תוסף VSTO/COM ל-Outlook ל-Windows שמאפשר לעו"ד לתייק מיילים ל-EspoCRM ישירות מ-Outlook, בלי הגדרת BCC.
פיצ'רים
- תיוק מייל קיים לתיק/לקוח — Ribbon button "File to EspoCRM" עם דיאלוג חיפוש (Case/Contact/Lead/Account).
- חיפוש לקוח/תיק על מייל נכנס — Reading-pane sidebar שמזהה את השולח ומציג את התיקים הקיימים.
- כתיבת מייל חדש מתוך תיק — מ-Outlook (Ribbon ב-compose) או מ-EspoCRM (URL protocol
outlookaddin://compose?caseId=...). - סנכרון אוטומטי של תיקיות נבחרות — Auto-file למיילים שמגיעים לתיקיות שמוגדרות לניטור.
דרישות
- Windows 10/11
- Outlook desktop: Microsoft 365 / Office 2021 / Office 2019 (לא 2016)
- .NET Framework 4.8 (מובנה ב-Win10/11)
- API key ב-EspoCRM (מקבלים מאדמין)
התקנה
ClickOnce — לחץ על הלינק https://platform.dev.marcus-law.co.il/outlook-addin/setup.exe ועקוב אחר ההוראות. Outlook יעלה מחדש אוטומטית.
ארכיטקטורה
- Server-side: MailRouter v1.2.0 חושף
POST /api/v1/MailRouter/file. - Client-side: ה-Add-in מדבר עם MailRouter (file) + EspoCRM REST API (search/lookup).
- Auth:
Espo-Authorization: <base64(username:apiKey)>per-user.
מבנה ה-Solution: ראה docs/ARCHITECTURE.md.
פיתוח
# ב-Windows machine עם VS 2022 + VSTO workload
git clone https://gitea.dev.marcus-law.co.il/espocrm-extensions/OutlookAddin.git
cd OutlookAddin
nuget restore
msbuild /t:Build /p:Configuration=Debug
# F5 ב-VS מפעיל Outlook עם ה-Add-in טעון לדיבאג
CI build על Windows runner ב-Gitea Actions — ראה .gitea/workflows/build.yml.
רישיון
Internal use only — Marcus-Law.
Description
Languages
C#
99.2%
PowerShell
0.4%
Dockerfile
0.4%