Bugzilla – Attachment 131518 Details for
Bug 9097
Add option to trigger 'Welcome mail' manually
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9097: Add option to manually send welcome email
Bug-9097-Add-option-to-manually-send-welcome-email.patch (text/plain), 3.23 KB, created by
Martin Renvoize (ashimema)
on 2022-03-09 12:16:45 UTC
(
hide
)
Description:
Bug 9097: Add option to manually send welcome email
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-03-09 12:16:45 UTC
Size:
3.23 KB
patch
obsolete
>From 60109e1fc95709be8c68c23fcecc36318e1bda5e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 8 Mar 2022 16:43:01 +0000 >Subject: [PATCH] Bug 9097: Add option to manually send welcome email > >This patch adds a new 'Send welcome email' option to the 'More' dropdown >menu in the patrons toolbar. > >Clicking the button will queue the welcome email again for the patron and >redirect the user to the Notices tab to view it's contents. >--- > .../prog/en/includes/members-toolbar.inc | 4 +++ > members/notices.pl | 35 ++++++++++++++++++- > 2 files changed, 38 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 6b0d8c12ac..0b3d74095d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -64,6 +64,10 @@ > [% END %] > [% END %] > >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <li><a id="sendwelcome" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% patron.borrowernumber | uri %]&op=send_welcome">Send welcome email</a></li> >+ [% END %] >+ > [% IF CAN_user_borrowers_delete_borrowers %] > <li><a id="deletepatron" href="#">Delete</a></li> > [% ELSE %] >diff --git a/members/notices.pl b/members/notices.pl >index c729d3fb1e..c954b854c6 100755 >--- a/members/notices.pl >+++ b/members/notices.pl >@@ -24,7 +24,7 @@ use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); > use CGI qw ( -utf8 ); > use C4::Members; >-use C4::Letters; >+use C4::Letters qw( GetPreparedLetter EnqueueLetter ); > use Koha::Patrons; > use Koha::Patron::Categories; > >@@ -60,6 +60,39 @@ if ( $op eq 'resend_notice' ) { > } > } > >+if ( $op eq 'send_welcome' ) { >+ my $emailaddr = $patron->notice_email_address; >+ >+ # if we manage to find a valid email address, send notice >+ if ($emailaddr) { >+ eval { >+ my $letter = GetPreparedLetter( >+ module => 'members', >+ letter_code => 'WELCOME', >+ branchcode => $patron->branchcode,, >+ lang => $patron->lang || 'default', >+ tables => { >+ 'branches' => $patron->branchcode, >+ 'borrowers' => $patron->borrowernumber, >+ }, >+ want_librarian => 1, >+ ) or return; >+ >+ my $message_id = EnqueueLetter( >+ { >+ letter => $letter, >+ borrowernumber => $patron->id, >+ to_address => $emailaddr, >+ message_transport_type => 'email' >+ } >+ ); >+ }; >+ } >+ >+ # redirect to self to avoid form submission on refresh >+ print $input->redirect("/cgi-bin/koha/members/notices.pl?borrowernumber=$borrowernumber"); >+} >+ > # Getting the messages > my $queued_messages = C4::Letters::GetQueuedMessages({borrowernumber => $borrowernumber}); > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9097
:
131493
|
131518
|
132916