Bug 18397 - Add recipient/sender information to notices tab in staff interface
Summary: Add recipient/sender information to notices tab in staff interface
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Aleisha Amohia
URL:
Keywords:
: 35664 (view as bug list)
Depends on: 12532
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-07 07:12 UTC by Marc Véron
Modified: 2024-02-14 20:50 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Display `from`, `to` and `cc` addresses under 'Delivery details' in the notices table once the notice has been sent.
Version(s) released in:
24.05.00


Attachments
Bug 18397 - Sent notices for...: Display email addresses (sender / recipient) (2.60 KB, patch)
2017-04-07 09:41 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18397: Add message delivery details to the notices tab (5.93 KB, patch)
2023-11-08 16:43 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 18397: Add message delivery details to the notices tab (6.60 KB, patch)
2023-11-09 08:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 18397: Add message delivery details to the notices tab (8.26 KB, patch)
2023-11-09 08:29 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 18397: Add message delivery details to the notices tab (8.30 KB, patch)
2023-11-09 13:00 UTC, David Nind
Details | Diff | Splinter Review
Bug 18397: Add message delivery details to the notices tab (8.36 KB, patch)
2023-12-20 01:09 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2017-04-07 07:12:52 UTC
Display in Home > Patrons > Sent notices for... the email address and the field where it is taken from.
Comment 1 Marc Véron 2017-04-07 09:32:56 UTC
Changed title.
Comment 2 Marc Véron 2017-04-07 09:41:14 UTC
Created attachment 61963 [details] [review]
Bug 18397 - Sent notices for...: Display email addresses (sender / recipient)

This patch adds the colums Sender and Recipient to the table of sent notices in
Home > Patrons > Sent notices for...

Related to Bug 18397 - Sent notices for...: Display email addresses (sender / recipient)

To test:
- Appply patch
- Go to a patron's page for sent notices (members/notices.pl)
- Verify that two new columns display sender and recipient
- Use this patch to test 18397
Comment 3 Marc Véron 2017-04-07 11:14:42 UTC
Comment on attachment 61963 [details] [review]
Bug 18397 - Sent notices for...: Display email addresses (sender / recipient)

Does not work on top of 12802
Comment 4 Katrin Fischer 2023-02-26 12:28:27 UTC
I wonder if this is still something people would be interested in?

We could take the recipient from the to_address, but it looks like the from_address is not always set/filled in the message_queue table. (tested with checkout/checkin notices)
Comment 5 Martin Renvoize 2023-11-08 16:43:08 UTC
Created attachment 158666 [details] [review]
Bug 18397: Add message delivery details to the notices tab

This patch adds further delivery details to the notices tab in patron
details in the staff client.

Once a message is sent, we display the 'from:', 'to:' and 'cc:'
addresses in the 'Delivery note' column when they exist.
Comment 6 Martin Renvoize 2023-11-08 16:48:50 UTC
Once we send the message these are more likely to be stored, but still not guarunteed yet.

I've opted to put them in conditionals for now and we can investigate cases when they're missing down the line.

I think this is a nice simple solution for the request for now.
Comment 7 Martin Renvoize 2023-11-08 16:49:30 UTC
Might be worth wrapping the label parts in a `<span class="label">` too.. be interested on your take there Owen.
Comment 8 David Nind 2023-11-08 23:26:00 UTC
I'm not sure how to test this - I didn't get the results I expected.

Is there a specific scenario that works, or is this just enabling it and notices/other changes required to make this display as expected?

Testing notes (using KTD):

1. Enabled KTD so I can send email [1] (without email configured the delivery note displayed "Unhandled email failure, check the logs for further details").

2. I added email addresses to two patrons and to KohaAdminEmailAddress, and ran misc/cronjobs/process_message_queue.pl after generating notices.

3. For the two patrons with email addresses, mad one a guarantor.

4. Sent Welcome messages (Patron account > More > Send welcome email) - nothing in delivery note column.

5. Checkout out an item to the guarantee (item checkout email enabled) - nothing in delivery note column.


[1] To test sending emails using a Google account:
    - Set up an App password for your Google Account
    - Edit /etc/koha/sites/kohadev/koha-conf.xml file and add this configuration near the end (where <user_name> = your Google email address; <password> = your APP password, not your Google account password):

 <smtp_server>
    <host>smtp.gmail.com</host>
    <port>587</port>
    <timeout>5</timeout>
    <ssl_mode>STARTTLS</ssl_mode>
    <user_name>GOOGLEACCOUNTUSER</user_name>
    <password>GOOGLEAPPPASSWORD</password>
    <debug>1</debug>
 </smtp_server>
Comment 9 Martin Renvoize 2023-11-09 08:20:35 UTC
Created attachment 158703 [details] [review]
Bug 18397: Add message delivery details to the notices tab

This patch adds further delivery details to the notices tab in patron
details in the staff client.

Once a message is sent, we display the 'from:', 'to:' and 'cc:'
addresses in the 'Delivery note' column when they exist.
Comment 10 Martin Renvoize 2023-11-09 08:29:09 UTC
Created attachment 158704 [details] [review]
Bug 18397: Add message delivery details to the notices tab

This patch adds further delivery details to the notices tab in patron
details in the staff client.

Once a message is sent, we display the 'from:', 'to:' and 'cc:'
addresses in the 'Delivery note' column when they exist.

Test plan
1. Enable KTD to send email [1] (without email configured the
   delivery note displayed "Unhandled email failure, check the logs for
   further details").

2. Add email addresses to two patrons and to KohaAdminEmailAddress,
   and run misc/cronjobs/process_message_queue.pl after generating
   notices.

3. For the two patrons with email addresses, make one a guarantor.

4. Sent Welcome messages (Patron account > More > Send welcome email) -
   nothing in delivery note column.

5. Checkout out an item to the guarantee (item checkout email enabled) -
   nothing in delivery note column.

6. Send the notices by running misc/cronjobs/process_message_queue.pl
   again.

7. Now the 'Delivery note' columns should contain from:, to: and cc:
   address details.

[1] Option 1 - smpt-sink (aka the sandboxes way)
    - Install the postfix package inside ktd (sudo apt install postfix)
      When asked in the wizard, I named mine 'local'
    - Start smpt-sink with
      `nohup smtp-sink -u root -D mail 127.0.0.1:25 100 </dev/null >/dev/null 2>&1 &`

    Option 2 - To test sending emails using a Google account:
    - Set up an App password for your Google Account
    - Edit /etc/koha/sites/kohadev/koha-conf.xml file and add this
      configuration near the end (where <user_name> = your Google email
      address; <password> = your APP password, not your Google account
      password):

      <smtp_server>
        <host>smtp.gmail.com</host>
        <port>587</port>
        <timeout>5</timeout>
        <ssl_mode>STARTTLS</ssl_mode>
        <user_name>GOOGLEACCOUNTUSER</user_name>
        <password>GOOGLEAPPPASSWORD</password>
        <debug>1</debug>
      </smtp_server>
Comment 11 Martin Renvoize 2023-11-09 08:30:57 UTC
Doh, 

Thanks for testing David.  Seems I managed to miss one of the files changed in the original commit.

I've corrected that now and uploaded the new patch. Your test plan was almost perfect.. I've just added a slightly amended version into the commit message now. Thanks.
Comment 12 David Nind 2023-11-09 13:00:59 UTC
Created attachment 158712 [details] [review]
Bug 18397: Add message delivery details to the notices tab

This patch adds further delivery details to the notices tab in patron
details in the staff client.

Once a message is sent, we display the 'from:', 'to:' and 'cc:'
addresses in the 'Delivery note' column when they exist.

Test plan
1. Enable KTD to send email [1] (without email configured the
   delivery note displayed "Unhandled email failure, check the logs for
   further details").

2. Add email addresses to two patrons and to KohaAdminEmailAddress,
   and run misc/cronjobs/process_message_queue.pl after generating
   notices.

3. For the two patrons with email addresses, make one a guarantor.

4. Sent Welcome messages (Patron account > More > Send welcome email) -
   nothing in delivery note column.

5. Checkout out an item to the guarantee (item checkout email enabled) -
   nothing in delivery note column.

6. Send the notices by running misc/cronjobs/process_message_queue.pl
   again.

7. Now the 'Delivery note' columns should contain from:, to: and cc:
   address details.

[1] Option 1 - smpt-sink (aka the sandboxes way)
    - Install the postfix package inside ktd (sudo apt install postfix)
      When asked in the wizard, I named mine 'local'
    - Start smpt-sink with
      `nohup smtp-sink -u root -D mail 127.0.0.1:25 100 </dev/null >/dev/null 2>&1 &`

    Option 2 - To test sending emails using a Google account:
    - Set up an App password for your Google Account
    - Edit /etc/koha/sites/kohadev/koha-conf.xml file and add this
      configuration near the end (where <user_name> = your Google email
      address; <password> = your APP password, not your Google account
      password):

      <smtp_server>
        <host>smtp.gmail.com</host>
        <port>587</port>
        <timeout>5</timeout>
        <ssl_mode>STARTTLS</ssl_mode>
        <user_name>GOOGLEACCOUNTUSER</user_name>
        <password>GOOGLEAPPPASSWORD</password>
        <debug>1</debug>
      </smtp_server>

Signed-off-by: David Nind <david@davidnind.com>
Comment 13 David Nind 2023-11-09 13:03:13 UTC
Testing notes (using KTD):

1. To see the cc information for guarantees/guarantors, enable RedirectGuaranteeEmail

Thanks for the tip about smpt-sink for KTD!
Comment 14 Aleisha Amohia 2023-12-20 01:09:45 UTC
Created attachment 160089 [details] [review]
Bug 18397: Add message delivery details to the notices tab

This patch adds further delivery details to the notices tab in patron
details in the staff client.

Once a message is sent, we display the 'from:', 'to:' and 'cc:'
addresses in the 'Delivery note' column when they exist.

Test plan
1. Enable KTD to send email [1] (without email configured the
   delivery note displayed "Unhandled email failure, check the logs for
   further details").

2. Add email addresses to two patrons and to KohaAdminEmailAddress,
   and run misc/cronjobs/process_message_queue.pl after generating
   notices.

3. For the two patrons with email addresses, make one a guarantor.

4. Sent Welcome messages (Patron account > More > Send welcome email) -
   nothing in delivery note column.

5. Checkout out an item to the guarantee (item checkout email enabled) -
   nothing in delivery note column.

6. Send the notices by running misc/cronjobs/process_message_queue.pl
   again.

7. Now the 'Delivery note' columns should contain from:, to: and cc:
   address details.

[1] Option 1 - smpt-sink (aka the sandboxes way)
    - Install the postfix package inside ktd (sudo apt install postfix)
      When asked in the wizard, I named mine 'local'
    - Start smpt-sink with
      `nohup smtp-sink -u root -D mail 127.0.0.1:25 100 </dev/null >/dev/null 2>&1 &`

    Option 2 - To test sending emails using a Google account:
    - Set up an App password for your Google Account
    - Edit /etc/koha/sites/kohadev/koha-conf.xml file and add this
      configuration near the end (where <user_name> = your Google email
      address; <password> = your APP password, not your Google account
      password):

      <smtp_server>
        <host>smtp.gmail.com</host>
        <port>587</port>
        <timeout>5</timeout>
        <ssl_mode>STARTTLS</ssl_mode>
        <user_name>GOOGLEACCOUNTUSER</user_name>
        <password>GOOGLEAPPPASSWORD</password>
        <debug>1</debug>
      </smtp_server>

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 15 Katrin Fischer 2023-12-28 20:32:12 UTC
*** Bug 35664 has been marked as a duplicate of this bug. ***
Comment 16 Katrin Fischer 2024-01-31 13:45:39 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 17 Fridolin Somers 2024-02-13 10:27:19 UTC
Small usefull enhancement, I backport

Pushed to 23.11.x for 23.11.03