open_social icon indicating copy to clipboard operation
open_social copied to clipboard

Feature 3261031 email notification timeslot

Open slowflyer opened this issue 3 years ago • 3 comments

Problem

The daily and weekly email notifications are send out more or less random over 24hours of day. If they are send out during the night, users will maybe not take as much attention to it, when clean up there mailbox in the morning compared to an email send during "business"-hours.

Solution

Define a time slot for sending out daily and weekly notifactions. Add an administer interface to "/admin/config/opensocial/swiftmail" which should be the best place for this setting. Allow admins to define a time slot for sending out email notifications.

Issue tracker

https://www.drupal.org/project/social/issues/3261031

How to test

For example

  • [x] Using version 11 Open Social
  • [x] As a administrator
  • [x] Define a bunch of activities as daily or weekly email notifiactions
  • [x] Define a time slot at /admin/config/opensocial/swiftmail (if not emails are send out by default between 0:00 and 23:55)
  • [x] Check that you receive the emails during the specified timeslot (maybe first on day 2)

Screenshots

If this Pull Request makes visual changes then please include some screenshots that show what has changed here. A before and after screenshot helps the reviewer determine what changes were made.

Release notes

A short summary of the changes that were made that can be included in release notes.

Change Record

If this Pull Request changes the way that developers should do things or introduces a new API for developers then a change record to document this is needed. Please provide a draft for a change record or a link to an unpublished change record below. Existing change records can be consulted as example.

Translations

Translatable strings are always extracted from the latest development branch. To ensure translations remain available for platforms running older versions of Open Social the original string should be added to translations.php when it's changed or removed.

  • [ ] Changed or removed source strings are added to the translations.php file.

slowflyer avatar Feb 02 '22 10:02 slowflyer

Weird behaviour of Coding Standards / PHPStan (pull_request) check. If a validateForm function is implemented I get the error: Error: Method Drupal\social_swiftmail\Form\SocialSwiftmailSettingsForm::validateForm() has no return type specified.

If I add a declaration for a return I get: Error:

slowflyer avatar Feb 03 '22 10:02 slowflyer

Hi @slowflyer

You can fix it with adding void: public function validateForm(array &$form, FormStateInterface $form_state): void {

Ressinel avatar Feb 03 '22 11:02 Ressinel

@slowflyer please rebase your branch with main, it would also help us if you can update the PR description as per the template suggested :-D. Thank you for your contribution.

navneet0693 avatar Feb 22 '22 04:02 navneet0693

Thank you for your contribution, we are going to close this PR as outdated, please feel free to reopen if still relevant

tbsiqueira avatar Dec 09 '22 12:12 tbsiqueira