From 48d05823861197c6ac1bdda79a0db952e9b44a43 Mon Sep 17 00:00:00 2001 From: Vino-S Date: Wed, 3 Jul 2024 12:56:04 +0100 Subject: [PATCH] coomunicate issue creation to member --- app/mailers/user_mailer.rb | 7 +++++++ app/models/feedback.rb | 1 + .../user_mailer/communicate_github_issue_creation.html.erb | 5 +++++ 3 files changed, 13 insertions(+) create mode 100644 app/views/user_mailer/communicate_github_issue_creation.html.erb diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 6e051a2b2..1018d712b 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -279,6 +279,13 @@ def freecen_vld_invalid_pob_report(email_subject, email_body, report, report_nam mail(:to => email_addresses, :cc => cc_addresses, :subject => email_subject, :body => email_body) end + def communicate_github_issue_creation(feedback) + @feedback = feedback + @user = UseridDetail.where(userid: feedback.user_id).first + @user_email = @user.email_address + mail(to: @user_email, :subject => 'Notification of github issue creation') + end + def notification_of_technical_registration(user) @appname = appname @user = user diff --git a/app/models/feedback.rb b/app/models/feedback.rb index 9bca38dad..c92a127f2 100644 --- a/app/models/feedback.rb +++ b/app/models/feedback.rb @@ -255,6 +255,7 @@ def github_issue logger.info("#{appname}:GITHUB response: #{response}") logger.info(response.inspect) self.update_attributes(:github_issue_url => response[:html_url],:github_comment_url => response[:comments_url], :github_number => response[:number]) + UserMailer.communicate_github_issue_creation(self).deliver_now else logger.error("#{appname}:Tried to create an issue, but Github integration is not enabled!") end diff --git a/app/views/user_mailer/communicate_github_issue_creation.html.erb b/app/views/user_mailer/communicate_github_issue_creation.html.erb new file mode 100644 index 000000000..7c9060885 --- /dev/null +++ b/app/views/user_mailer/communicate_github_issue_creation.html.erb @@ -0,0 +1,5 @@ +

Dear <%= @user.userid%>

+

You had submitted some feedback to <%= @appname %> reference + <%= @feedback.identifier %> + to us with the title <%= @feedback.title%> at <%= @feedback.feedback_time.strftime("%H:%M on %F") unless @feedback.feedback_time.nil?%>

+

This email is to notify you that we have created an github issue and you can monitor the progess here: <%= link_to "link to github issue", @feedback.github_issue_url %>

\ No newline at end of file