מדריך מקיף לכל ערוצי התקשורת הנתמכים במערכת, כולל הגדרות, אינטגרציות וספקים חיצוניים.
שליחת הודעות דואר אלקטרוני עם תמיכה ב-HTML, קבצים מצורפים ומעקב אחר פתיחות וקליקים.
שליחת הודעות WhatsApp עם תמיכה בטקסט, תמונות, קבצים ותבניות WhatsApp Business.
שליחת הודעות SMS עם תמיכה בעברית, Unicode ותזמון הודעות.
התראות Push לדפדפנים ואפליקציות מובייל עם תמיכה בקישורים ופעולות.
חיבור ישיר לשרת SMTP - מתאים לכל ספק
| פרמטר | סוג | חובה | תיאור |
|---|---|---|---|
host |
string | כן | כתובת שרת SMTP |
port |
integer | כן | פורט (587 TLS / 465 SSL / 25) |
username |
string | כן | שם משתמש לאימות |
password |
string | כן | סיסמה / App Password |
from_email |
string | כן | כתובת השולח |
from_name |
string | לא | שם השולח |
use_tls |
boolean | לא | הצפנת TLS (ברירת מחדל: true) |
{
"type": "email",
"provider": "smtp",
"config": {
"host": "smtp.gmail.com",
"port": 587,
"username": "your-email@gmail.com",
"password": "your-app-password",
"from_email": "noreply@yourdomain.com",
"from_name": "TechLabs",
"use_tls": true
}
}
שירות Email מתקדם עם מעקב וניתוח
{
"type": "email",
"provider": "sendgrid",
"config": {
"api_key": "SG.xxxxxxxxxxxxxxx",
"from_email": "noreply@yourdomain.com",
"from_name": "TechLabs"
}
}
שירות Email של AWS - מומלץ לנפחים גבוהים
{
"type": "email",
"provider": "ses",
"config": {
"aws_access_key": "AKIAXXXXXXXXXXXXXXXX",
"aws_secret_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"region": "eu-west-1",
"from_email": "noreply@yourdomain.com"
}
}
הטמעת Pixel שקוף למעקב אחר פתיחת הודעות
החלפת קישורים במעקב לניתוח קליקים
תמיכה בכל סוגי הקבצים עד 25MB
עיצוב מותאם עם תבניות HTML מלאות
ספק WhatsApp API פשוט ומהיר לאינטגרציה. מאפשר שליחה וקבלה של הודעות ללא אישור מראש.
| פרמטר | תיאור |
|---|---|
instance_id |
מזהה Instance מ-Green-API |
api_token |
API Token לאימות |
webhook_url |
URL לקבלת עדכונים (אופציונלי) |
{
"type": "whatsapp",
"provider": "green-api",
"config": {
"instance_id": "1234567890",
"api_token": "your-api-token-here",
"webhook_url": "https://yourdomain.com/webhook/whatsapp"
}
}
פלטפורמת תקשורת מובילה עם תמיכה ב-WhatsApp Business API. דורש אישור מ-Meta לתבניות שיווקיות.
{
"type": "whatsapp",
"provider": "twilio",
"config": {
"account_sid": "ACxxxxxxxxxxxxxxxxx",
"auth_token": "your-auth-token",
"from_number": "whatsapp:+14155238886"
}
}
API רשמי של Meta/WhatsApp - מומלץ לעסקים גדולים.
{
"type": "whatsapp",
"provider": "meta",
"config": {
"phone_number_id": "123456789",
"access_token": "EAAxxxxxxxxxx",
"business_id": "987654321",
"webhook_verify_token": "your-verify-token"
}
}
פלטפורמת SMS מובילה עולמית
{
"type": "sms",
"provider": "twilio",
"config": {
"account_sid": "ACxxxxxxxxxxxxxxxxx",
"auth_token": "your-auth-token",
"from_number": "+15551234567",
"messaging_service_sid": "MGxxxxxxxxx" // אופציונלי
}
}
תמיכה בספקי SMS ישראליים
{
"type": "sms",
"provider": "local",
"config": {
"api_url": "https://api.sms-provider.co.il",
"api_key": "your-api-key",
"sender_id": "TechLabs",
"unicode": true
}
}
| פרמטר | ערך | הערות |
|---|---|---|
| אורך הודעה (ASCII) | 160 תווים | הודעה אחת |
| אורך הודעה (Unicode/עברית) | 70 תווים | הודעה אחת |
| הודעה ארוכה | עד 1600 תווים | מחולקת ל-10 הודעות |
| Sender ID | עד 11 תווים | באותיות לטיניות בלבד |
שירות Push של Google - תומך ב-Web ו-Mobile
{
"type": "push",
"provider": "firebase",
"config": {
"project_id": "your-firebase-project",
"private_key": "-----BEGIN PRIVATE KEY-----\n...",
"client_email": "firebase-adminsdk@project.iam.gserviceaccount.com",
"vapid_public_key": "BxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxN",
"vapid_private_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
פלטפורמת Push מתקדמת עם ניתוח
{
"type": "push",
"provider": "onesignal",
"config": {
"app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"api_key": "your-onesignal-api-key"
}
}
התראות לדפדפנים - Chrome, Firefox, Safari, Edge
התראות לאפליקציות iOS ו-Android
| תכונה | SMS | Push | ||
|---|---|---|---|---|
| עלות | נמוכה | בינונית | גבוהה | חינם |
| שיעור פתיחה | 20-30% | 90%+ | 95%+ | 40-60% |
| זמן מסירה | שניות-דקות | מיידי | מיידי | מיידי |
| תוכן עשיר | ||||
| קבצים מצורפים | ||||
| מעקב | ||||
| דו-כיווני |
כל ערוץ מיושם כ-Adapter שמממש את ה-Interface הבסיסי. זה מאפשר הוספת ערוצים חדשים בקלות.
from abc import ABC, abstractmethod
class BaseChannelAdapter(ABC):
"""
Base class for all channel adapters.
All adapters must implement these methods.
"""
@abstractmethod
def send(self, recipient: str, content: str, **kwargs) -> dict:
"""
Send a message to a recipient.
Args:
recipient: The recipient address (email/phone/token)
content: The message content
**kwargs: Additional parameters (subject, attachments, etc.)
Returns:
dict with 'success', 'message_id', 'status'
"""
pass
@abstractmethod
def get_status(self, message_id: str) -> dict:
"""
Get the delivery status of a message.
Returns:
dict with 'status', 'delivered_at', 'error'
"""
pass
@abstractmethod
def validate_recipient(self, recipient: str) -> bool:
"""
Validate that the recipient address is valid for this channel.
"""
pass
def get_config_schema(self) -> dict:
"""
Return JSON Schema for configuration validation.
"""
return {}
def test_connection(self) -> dict:
"""
Test the connection to the provider.
"""
return {'success': True}
class EmailAdapter(BaseChannelAdapter):
"""SMTP Email Adapter implementation."""
def __init__(self, config: dict):
self.host = config['host']
self.port = config['port']
self.username = config['username']
self.password = config['password']
self.from_email = config['from_email']
self.from_name = config.get('from_name', '')
self.use_tls = config.get('use_tls', True)
def send(self, recipient: str, content: str, **kwargs) -> dict:
subject = kwargs.get('subject', 'הודעה חדשה')
html_content = kwargs.get('html_content')
attachments = kwargs.get('attachments', [])
try:
msg = MIMEMultipart('alternative')
msg['Subject'] = subject
msg['From'] = f"{self.from_name} <{self.from_email}>"
msg['To'] = recipient
# Add plain text
msg.attach(MIMEText(content, 'plain', 'utf-8'))
# Add HTML if provided
if html_content:
msg.attach(MIMEText(html_content, 'html', 'utf-8'))
# Add attachments
for attachment in attachments:
self._add_attachment(msg, attachment)
# Send via SMTP
with smtplib.SMTP(self.host, self.port) as server:
if self.use_tls:
server.starttls()
server.login(self.username, self.password)
server.send_message(msg)
return {
'success': True,
'message_id': msg['Message-ID'],
'status': 'sent'
}
except Exception as e:
return {
'success': False,
'error': str(e),
'status': 'failed'
}
def validate_recipient(self, recipient: str) -> bool:
import re
pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
return bool(re.match(pattern, recipient))