add email notif template to schema

- update migration
This commit is contained in:
Abhinav Raut
2026-01-01 14:43:40 +05:30
parent 1aa2d91432
commit 28fa0bad23
2 changed files with 25 additions and 5 deletions
+5 -5
View File
@@ -25,11 +25,11 @@ func V0_10_0(db *sqlx.DB, fs stuffbin.FileSystem, ko *koanf.Koanf) error {
CREATE TABLE IF NOT EXISTS conversation_mentions (
id BIGSERIAL PRIMARY KEY,
created_at TIMESTAMPTZ DEFAULT NOW(),
conversation_id BIGINT REFERENCES conversations(id) ON DELETE CASCADE NOT NULL,
message_id BIGINT REFERENCES conversation_messages(id) ON DELETE CASCADE NOT NULL,
mentioned_user_id BIGINT REFERENCES users(id) ON DELETE CASCADE,
mentioned_team_id INT REFERENCES teams(id) ON DELETE CASCADE,
mentioned_by_user_id BIGINT REFERENCES users(id) ON DELETE CASCADE NOT NULL,
conversation_id BIGINT REFERENCES conversations(id) ON DELETE CASCADE ON UPDATE CASCADE NOT NULL,
message_id BIGINT REFERENCES conversation_messages(id) ON DELETE CASCADE ON UPDATE CASCADE NOT NULL,
mentioned_user_id BIGINT REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE,
mentioned_team_id INT REFERENCES teams(id) ON DELETE CASCADE ON UPDATE CASCADE,
mentioned_by_user_id BIGINT REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE NOT NULL,
CONSTRAINT constraint_mention_target CHECK (
(mentioned_user_id IS NOT NULL AND mentioned_team_id IS NULL) OR
(mentioned_user_id IS NULL AND mentioned_team_id IS NOT NULL)
+20
View File
@@ -808,3 +808,23 @@ VALUES (
'Urgent: SLA Breach for Conversation {{ .Conversation.ReferenceNumber }} for {{ .SLA.Metric }}',
true
);
INSERT INTO templates
("type", body, is_default, "name", subject, is_builtin)
VALUES (
'email_notification'::template_type,
'<p>{{ .Author.FullName }} mentioned you in a private note on conversation #{{ .Conversation.ReferenceNumber }}.</p>
<p>
<a href="{{ RootURL }}/inboxes/mentioned/conversation/{{ .Conversation.UUID }}?scrollTo={{ .Message.UUID }}">View Conversation</a>
</p>
<p>
Best regards,<br>
Libredesk
</p>',
false,
'Mentioned in conversation',
'{{ .Author.FullName }} mentioned you in conversation #{{ .Conversation.ReferenceNumber }}',
true
);