diff --git a/conferenceadmin.go b/conferenceadmin.go index 2b3d1e8..0d79ffb 100644 --- a/conferenceadmin.go +++ b/conferenceadmin.go @@ -514,6 +514,27 @@ func ConfReports(ctxt ui.AmContext) (string, any) { } } +func ConferenceEmailForm(ctxt ui.AmContext) (string, any) { + comm := ctxt.CurrentCommunity() + conf := ctxt.GetScratch("currentConference").(*database.Conference) + myLevel := ctxt.GetScratch("levelInConference").(uint16) + if !conf.TestPermission("Conference.EMailParticipants", myLevel) { + return "error", ENOPERM + } + + topics, err := database.AmListTopics(ctxt.Ctx(), conf.ConfId, ctxt.CurrentUserId(), database.TopicViewAll, database.TopicSortName, true) + if err != nil { + return "error", err + } + ctxt.VarMap().Set("topics", topics) + ctxt.VarMap().Set("confName", conf.Name) + ctxt.VarMap().Set("selfLink", fmt.Sprintf("/comm/%s/conf/%s/email", comm.Alias, ctxt.GetScratch("currentAlias"))) + ctxt.VarMap().Set("porl", 0).Set("top", 0).Set("xday", false) + ctxt.VarMap().Set("day", 7).Set("subj", "").Set("pb", "") + ctxt.SetFrameTitle(fmt.Sprintf("Conference E-Mail: %s", conf.Name)) + return "framed", "conf_email.jet" +} + /* CreateConferenceForm displays the dialog for creating a new conference. * Parameters: * ctxt - The AmContext for the request. diff --git a/main.go b/main.go index 08d0fab..c99f7fc 100644 --- a/main.go +++ b/main.go @@ -122,6 +122,7 @@ func setupEcho() *echo.Echo { confGroup.GET("/custom", ui.AmWrap(ConfCustomForm)) confGroup.POST("/custom", ui.AmWrap(ConfCustom)) confGroup.GET("/activity", ui.AmWrap(ConfReports)) + confGroup.GET("/email", ui.AmWrap(ConferenceEmailForm)) confGroup.GET("/hotlist", ui.AmWrap(AddToHotlist)) confGroup.GET("/invite", ui.AmWrap(InviteToConference)) confGroup.GET("/r/:topic", ui.AmWrap(ReadPosts), ui.SetTopic) diff --git a/ui/menudefs.yaml b/ui/menudefs.yaml index 3fde818..eda33c9 100644 --- a/ui/menudefs.yaml +++ b/ui/menudefs.yaml @@ -102,7 +102,7 @@ menudefs: - text: "Conference Activity Reports" link: "/comm/[CID]/conf/[CONFID]/activity" - text: "Conference E-Mail" - link: "/TODO/comm/[CID]/conf/[CONFID]/email" + link: "/comm/[CID]/conf/[CONFID]/email" - text: "Export Messages" link: "/TODO/comm/[CID]/conf/[CONFID]/export" - text: "Import Messages" diff --git a/ui/views/conf_email.jet b/ui/views/conf_email.jet new file mode 100644 index 0000000..28062ab --- /dev/null +++ b/ui/views/conf_email.jet @@ -0,0 +1,132 @@ +{* + * Amsterdam Web Communities System + * Copyright (c) 2025-2026 Erbosoft Metaverse Design Solutions, All Rights Reserved + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + *} +
Administrator Notice:
+You are about to send an E-mail to conference members. Please use this feature responsibly. Recipients will receive the email based on the criteria you select below.
+