From 7993e2ad1b9162570aff2287f4a94919fc9092d9 Mon Sep 17 00:00:00 2001 From: anthony-ricci Date: Mon, 9 Dec 2024 12:10:15 -0500 Subject: [PATCH] messages-to-email (#7193) --- app/destinations/app_config.php | 8 +++++ app/destinations/app_languages.php | 52 +++++++++++++++++++++++++++ app/destinations/destination_edit.php | 35 ++++++++++++++++++ app/messages | 1 + app/providers | 1 + 5 files changed, 97 insertions(+) create mode 160000 app/messages create mode 160000 app/providers diff --git a/app/destinations/app_config.php b/app/destinations/app_config.php index 3e9b0f81f2..6f47d1103a 100644 --- a/app/destinations/app_config.php +++ b/app/destinations/app_config.php @@ -167,6 +167,10 @@ $y++; $apps[$x]['permissions'][$y]['name'] = "destination_local"; $y++; + $apps[$x]['permissions'][$y]['name'] = "destination_email"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; //default settings $y = 0; @@ -397,6 +401,10 @@ $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_email"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to send email notifications of incoming SMS/MMS messages"; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz'; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date'; diff --git a/app/destinations/app_languages.php b/app/destinations/app_languages.php index 56cd95c73e..a0043e04ad 100644 --- a/app/destinations/app_languages.php +++ b/app/destinations/app_languages.php @@ -1162,6 +1162,32 @@ $text['label-destination_conditions']['zh-cn'] = "状况"; $text['label-destination_conditions']['ja-jp'] = "条件"; $text['label-destination_conditions']['ko-kr'] = "정황"; +$text['label-destination_email']['en-gb'] = "Email Notifications"; +$text['label-destination_email']['ar-eg'] = "إشعارات البريد الإلكتروني"; +$text['label-destination_email']['de-at'] = "E-Mail-Benachrichtigungen"; +$text['label-destination_email']['de-ch'] = "E-Mail-Benachrichtigungen"; +$text['label-destination_email']['de-de'] = "E-Mail-Benachrichtigungen"; +$text['label-destination_email']['el-gr'] = "Ειδοποιήσεις μέσω ηλεκτρονικού ταχυδρομείου"; +$text['label-destination_email']['es-cl'] = "Notificaciones por correo electrónico"; +$text['label-destination_email']['es-mx'] = "Notificaciones por correo electrónico"; +$text['label-destination_email']['fr-ca'] = "Notifications par courriel"; +$text['label-destination_email']['fr-fr'] = "Notifications par e-mail"; +$text['label-destination_email']['he-il'] = "התראות דוא\"ל"; +$text['label-destination_email']['it-it'] = "Notifiche via email"; +$text['label-destination_email']['ka-ge'] = "ელ.ფოსტით შეტყობინებები"; +$text['label-destination_email']['nl-nl'] = "E-mailmeldingen"; +$text['label-destination_email']['pl-pl'] = "Powiadomienia e-mail"; +$text['label-destination_email']['pt-br'] = "Notificações por e-mail"; +$text['label-destination_email']['pt-pt'] = "Notificações por e-mail"; +$text['label-destination_email']['ro-ro'] = "Notificări prin e-mail"; +$text['label-destination_email']['ru-ru'] = "Уведомления по электронной почте"; +$text['label-destination_email']['sv-se'] = "E-postmeddelanden"; +$text['label-destination_email']['uk-ua'] = "Повідомлення електронною поштою"; +$text['label-destination_email']['tr-tr'] = "E-posta Bildirimleri"; +$text['label-destination_email']['zh-cn'] = "邮件通知"; +$text['label-destination_email']['ja-jp'] = "メール通知"; +$text['label-destination_email']['ko-kr'] = "이메일 알림"; + $text['option-caller_id_number']['en-us'] = "Caller ID Number"; $text['option-caller_id_number']['en-gb'] = "Caller ID Number"; $text['option-caller_id_number']['ar-eg'] = "رقم المتصل"; @@ -2352,6 +2378,32 @@ $text['description-usage']['zh-cn'] = "设置目的地的使用方式。"; $text['description-usage']['ja-jp'] = "宛先の使用方法を設定します。"; $text['description-usage']['ko-kr'] = "대상이 사용되는 방식을 설정합니다."; +$text['description-destination_email']['en-gb'] = "Choose whether to send SMS and MMS messages to User's email"; +$text['description-destination_email']['ar-eg'] = "اختر ما إذا كنت ترغب في إرسال رسائل SMS و MMS إلى بريد المستخدم الإلكتروني"; +$text['description-destination_email']['de-at'] = "Wählen Sie, ob SMS- und MMS-Nachrichten an die E-Mail des Benutzers gesendet werden sollen"; +$text['description-destination_email']['de-ch'] = "Wählen Sie, ob SMS- und MMS-Nachrichten an die E-Mail des Benutzers gesendet werden sollen"; +$text['description-destination_email']['de-de'] = "Wählen Sie, ob SMS- und MMS-Nachrichten an die E-Mail des Benutzers gesendet werden sollen"; +$text['description-destination_email']['el-gr'] = "Επιλέξτε αν θέλετε να στείλετε μηνύματα SMS και MMS στο email του χρήστη"; +$text['description-destination_email']['es-cl'] = "Elija si desea enviar mensajes SMS y MMS al correo electrónico del usuario"; +$text['description-destination_email']['es-mx'] = "Elija si desea enviar mensajes SMS y MMS al correo electrónico del usuario"; +$text['description-destination_email']['fr-ca'] = "Choisissez si vous souhaitez envoyer des messages SMS et MMS à l'email de l'utilisateur"; +$text['description-destination_email']['fr-fr'] = "Choisissez si vous souhaitez envoyer des messages SMS et MMS à l'email de l'utilisateur"; +$text['description-destination_email']['he-il'] = "בחר אם לשלוח הודעות SMS ו-MMS לדוא\"ל של המשתמש"; +$text['description-destination_email']['it-it'] = "Scegli se inviare messaggi SMS e MMS all'email dell'utente"; +$text['description-destination_email']['ka-ge'] = "აირჩიეთ, გსურთ თუ არა SMS და MMS შეტყობინებების გაგზავნა მომხმარებლის ელ.ფოსტაზე"; +$text['description-destination_email']['nl-nl'] = "Kies of je SMS- en MMS-berichten naar de e-mail van de gebruiker wilt sturen"; +$text['description-destination_email']['pl-pl'] = "Wybierz, czy chcesz wysłać wiadomości SMS i MMS na adres e-mail użytkownika"; +$text['description-destination_email']['pt-br'] = "Escolha se deseja enviar mensagens SMS e MMS para o e-mail do usuário"; +$text['description-destination_email']['pt-pt'] = "Escolha se deseja enviar mensagens SMS e MMS para o e-mail do usuário"; +$text['description-destination_email']['ro-ro'] = "Alegeți dacă doriți să trimiteți mesaje SMS și MMS la adresa de e-mail a utilizatorului"; +$text['description-destination_email']['ru-ru'] = "Выберите, хотите ли вы отправлять SMS и MMS сообщения на электронную почту пользователя"; +$text['description-destination_email']['sv-se'] = "Välj om du vill skicka SMS- och MMS-meddelanden till användarens e-post"; +$text['description-destination_email']['uk-ua'] = "Виберіть, чи хочете ви надсилати SMS і MMS повідомлення на електронну пошту користувача"; +$text['description-destination_email']['tr-tr'] = "Kullanıcının e-posta adresine SMS ve MMS mesajları gönderilip gönderilmeyeceğini seçin"; +$text['description-destination_email']['zh-cn'] = "选择是否将SMS和MMS消息发送到用户的电子邮件"; +$text['description-destination_email']['ja-jp'] = "ユーザーのメールにSMSおよびMMSメッセージを送信するかどうかを選択してください"; +$text['description-destination_email']['ko-kr'] = "사용자 이메일로 SMS 및 MMS 메시지를 보낼지 선택하세요"; + $text['billing-warning']['en-us'] = "If you are using fusionpbx billing application, make sure to add accountcode and carrier variables."; $text['billing-warning']['en-gb'] = "If you are using fusionpbx billing application, make sure to add accountcode and carrier variables."; $text['billing-warning']['ar-eg'] = "إذا كنت تستخدم تطبيق فواتير الدمج، تأكد من إضافة رمز الحساب والمتغيرات الناقلة."; diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index cfffa03f70..ba185c3c75 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -130,6 +130,7 @@ $destination_type_text = $_POST["destination_type_text"] ?? null; $destination_type_emergency = $_POST["destination_type_emergency"] ?? null; $destination_carrier = $_POST["destination_carrier"] ?? null; + $destination_email = $_POST["destination_email"]; //sanitize the destination conditions if (!empty($destination_conditions)) { @@ -314,6 +315,9 @@ if (!permission_exists('destination_domain')) { $domain_uuid = $row["domain_uuid"] ?? null; } + if (!permission_exists('destination_email')) { + $destination_email = $row["destination_email"] ?? null; + } } unset($row); @@ -1090,6 +1094,7 @@ $array['destinations'][$x]["destination_distinctive_ring"] = $destination_distinctive_ring; } $array['destinations'][$x]["destination_record"] = $destination_record; + $array['destinations'][$x]["destination_email"] = $destination_email; if (!empty($destination_ringback) && $ringbacks->valid($destination_ringback)) { $array['destinations'][$x]["destination_ringback"] = $destination_ringback; } @@ -1270,6 +1275,7 @@ $destination_order = $destination_order ?? ''; $destination_enabled = $destination_enabled ?? ''; $destination_description = $destination_description ?? ''; + $destination_email = $destination_email ?? ''; $select_style = $select_style ?? ''; //pre-populate the form @@ -1316,6 +1322,7 @@ $destination_order = $row["destination_order"]; $destination_enabled = $row["destination_enabled"]; $destination_description = $row["destination_description"]; + $destination_email = $row["destination_email"]; } unset($sql, $parameters, $row); } @@ -1815,6 +1822,34 @@ echo "\n"; } + //destination email + if (permission_exists('destination_email') && permission_exists('message_view')) { + echo "\n"; + echo "\n"; + echo " ".$text['label-destination_email']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-destination_email']."\n"; + echo "\n"; + echo "\n"; + } + //users if (permission_exists('user_edit')) { echo "\n"; diff --git a/app/messages b/app/messages new file mode 160000 index 0000000000..623feb4b1a --- /dev/null +++ b/app/messages @@ -0,0 +1 @@ +Subproject commit 623feb4b1a15e9b29a583a28fafb75e904d1e5c5 diff --git a/app/providers b/app/providers new file mode 160000 index 0000000000..a784816525 --- /dev/null +++ b/app/providers @@ -0,0 +1 @@ +Subproject commit a7848165253d0fe3445d961e8f374b5b48dace20