This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch clarify-intent
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/clarify-intent by this push:
     new 485d0746 Also need an action script to process the template
485d0746 is described below

commit 485d074689c8935f0ed048d6a747cdb135f8ac0b
Author: Sebb <[email protected]>
AuthorDate: Wed Jun 25 23:42:17 2025 +0100

    Also need an action script to process the template
---
 .../workbench/views/actions/clarify_intent.json.rb | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/www/secretary/workbench/views/actions/clarify_intent.json.rb 
b/www/secretary/workbench/views/actions/clarify_intent.json.rb
new file mode 100644
index 00000000..2b705308
--- /dev/null
+++ b/www/secretary/workbench/views/actions/clarify_intent.json.rb
@@ -0,0 +1,41 @@
+# extract message
+message = Mailbox.find(@message)
+
+# obtain per-user information
+_personalize_email(env.user)
+
+# extract/verify project
+_extract_project
+
+########################################################################
+#                           email submitter                            #
+########################################################################
+
+# send rejection email
+task "email #{message.from}" do
+  # build mail from template
+  @email = message.from
+  mail = message.reply(
+    from: @from,
+    cc: [
+      '[email protected]',
+      (@pmc.private_mail_list if @pmc), # copy pmc
+      (@podling.private_mail_list if @podling) # copy podling
+    ],
+    body: template('clarify-intent.erb')
+  )
+
+  # echo email
+  form do
+    _message mail.to_s
+  end
+
+  # deliver mail
+  complete do
+    _disposition :keep # set this first in case mail sending fails
+
+    mail.deliver!
+
+    _status 'request to clarify intent has been sent.'
+  end
+end

Reply via email to