diff --git a/resources/js/Components/PersonInfo/PersonInfoEmailDialog.vue b/resources/js/Components/PersonInfo/PersonInfoEmailDialog.vue
new file mode 100644
index 0000000..bb95c49
--- /dev/null
+++ b/resources/js/Components/PersonInfo/PersonInfoEmailDialog.vue
@@ -0,0 +1,483 @@
+
+
+
+
+
diff --git a/resources/js/Components/PersonInfo/PersonInfoEmailsTab.vue b/resources/js/Components/PersonInfo/PersonInfoEmailsTab.vue
index 87a97db..d9fcdd4 100644
--- a/resources/js/Components/PersonInfo/PersonInfoEmailsTab.vue
+++ b/resources/js/Components/PersonInfo/PersonInfoEmailsTab.vue
@@ -8,14 +8,16 @@ import {
} from "@/Components/ui/dropdown-menu";
import { Card } from "@/Components/ui/card";
import { Button } from "../ui/button";
-import { EllipsisVertical } from "lucide-vue-next";
+import { CircleCheckBigIcon, CircleXIcon, EllipsisVertical, MailIcon } from "lucide-vue-next";
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip";
const props = defineProps({
person: Object,
edit: { type: Boolean, default: true },
+ enableEmail: { type: Boolean, default: false },
});
-const emit = defineEmits(["add", "edit", "delete"]);
+const emit = defineEmits(["add", "edit", "delete", "email"]);
const getEmails = (p) => (Array.isArray(p?.emails) ? p.emails : []);
@@ -44,7 +46,17 @@ const handleDelete = (id, label) => emit("delete", id, label);
-
+
{{ email?.value || email?.email || email?.address || "-" }}
+
+
+
+
+
+ Veljavna
+
+
+
+
+
+
+
+ Neuspešna dostava
+
+
[] },
smsSenders: { type: Array, default: () => [] },
smsTemplates: { type: Array, default: () => [] },
+ enableEmail: { type: Boolean, default: false },
+ emailTemplates: { type: Array, default: () => [] },
+ mailProfiles: { type: Array, default: () => [] },
});
// Dialog states
@@ -91,6 +95,10 @@ const confirm = ref({
const showSmsDialog = ref(false);
const smsTargetPhone = ref(null);
+// Email dialog state
+const showEmailDialog = ref(false);
+const emailTarget = ref(null);
+
// Person handlers
const openDrawerUpdateClient = () => {
drawerUpdatePerson.value = true;
@@ -251,6 +259,18 @@ const closeSmsDialog = () => {
smsTargetPhone.value = null;
};
+// Email dialog handlers
+const openEmailDialog = (email) => {
+ if (!props.enableEmail || !props.clientCaseUuid) return;
+ emailTarget.value = email;
+ showEmailDialog.value = true;
+};
+
+const closeEmailDialog = () => {
+ showEmailDialog.value = false;
+ emailTarget.value = null;
+};
+
// Tab event handlers
const handlePersonEdit = () => openDrawerUpdateClient();
@@ -266,6 +286,7 @@ const handlePhoneSms = (phone) => openSmsDialog(phone);
const handleEmailAdd = () => openDrawerAddEmail(false, 0);
const handleEmailEdit = (id) => openDrawerAddEmail(true, id);
const handleEmailDelete = (id, label) => openConfirm("email", id, label);
+const handleEmailSend = (email) => openEmailDialog(email);
const handleTrrAdd = () => openDrawerAddTrr(false, 0);
const handleTrrEdit = (id) => openDrawerAddTrr(true, id);
@@ -418,9 +439,11 @@ const switchToTab = (tab) => {
@@ -534,4 +557,15 @@ const switchToTab = (tab) => {
:sms-templates="smsTemplates"
@close="closeSmsDialog"
/>
+
+
+
diff --git a/resources/js/Layouts/AppLayout.vue b/resources/js/Layouts/AppLayout.vue
index 34a281a..d2ba7b4 100644
--- a/resources/js/Layouts/AppLayout.vue
+++ b/resources/js/Layouts/AppLayout.vue
@@ -225,7 +225,7 @@ const rawMenuGroups = [
{
key: "packages",
icon: PackageIcon,
- title: "SMS paketi",
+ title: "Paketno pošiljanje",
routeName: "packages.index",
active: ["packages.index", "packages.show", "packages.create"],
},
diff --git a/resources/js/Pages/Admin/EmailTemplates/Edit.vue b/resources/js/Pages/Admin/EmailTemplates/Edit.vue
index edd5051..ba263f5 100644
--- a/resources/js/Pages/Admin/EmailTemplates/Edit.vue
+++ b/resources/js/Pages/Admin/EmailTemplates/Edit.vue
@@ -64,6 +64,7 @@ import "quill/dist/quill.snow.css";
const props = defineProps({
template: { type: Object, default: null },
+ actions: { type: Array, default: () => [] },
});
const form = useForm({
@@ -75,6 +76,9 @@ const form = useForm({
entity_types: props.template?.entity_types ?? ["client", "contract"],
allow_attachments: props.template?.allow_attachments ?? false,
active: props.template?.active ?? true,
+ client: props.template?.client ?? false,
+ action_id: props.template?.action_id ?? null,
+ decision_id: props.template?.decision_id ?? null,
});
const preview = ref({ subject: "", html: "", text: "" });
@@ -732,7 +736,8 @@ const placeholderGroups = computed(() => {
"contract.id",
"contract.uuid",
"contract.reference",
- "contract.amount",
+ "contract.account.balance_amount",
+ "contract.account.initial_amount",
"contract.meta.some_key",
]);
}
@@ -747,6 +752,13 @@ const placeholderGroups = computed(() => {
]);
// Extra is always useful for ad-hoc data
add("extra", "Extra", ["extra.some_key"]);
+ // Profile signature tokens (resolved from the active mail profile at send time)
+ add("profile", "Profil / Podpis", [
+ "profile.signature.ime",
+ "profile.signature.naziv",
+ "profile.signature.telefon",
+ "profile.signature.email",
+ ]);
return groups;
});
@@ -1028,6 +1040,49 @@ watch(
/>
+