Because some clients want to re-receive a newsletter again after the whole sending process completed, this feature request finally resulted.

Allow sending test newsletters independent of mail sent status or something else.
We could always allow sending a test message.

CommentFileSizeAuthor
#46 simplenews_1169990_tab_46-interdiff.txt2.5 KBberdir
#46 simplenews_1169990_tab_46.patch20.52 KBberdir
#45 simplenews_1169990_tab_45.patch20.45 KBAnushka-mp
#45 simplenews_1169990_tab_45_interdiff.txt12.58 KBAnushka-mp
#44 simplenews_1169990_tab_43.patch20.23 KBAnushka-mp
#42 simplenews_1169990_tab_42.patch20.27 KBAnushka-mp
#42 simplenews_1169990_tab_42_interdiff.txt8.32 KBAnushka-mp
#40 simplenews_1169990_tab_40.patch16.39 KBAnushka-mp
#40 simplenews_1169990_tab_40_interdiff.txt3.49 KBAnushka-mp
#35 simplenews_1169990_tab_33.patch16.34 KBAnushka-mp
#35 simplenews_1169990_tab_33_interdiff.txt882 bytesAnushka-mp
#32 Screen Shot 2015-01-26 at 12.11.59.png126 KBAnushka-mp
#31 simplenews_1169990_tab_31.patch16.33 KBAnushka-mp
#31 simplenews_1169990_tab_31_interdiff.txt2.51 KBAnushka-mp
#29 simplenews_1169990_tab_29.patch15.48 KBmiro_dietiker
#29 simplenews_1169990_tab_29.interdiff.txt1.76 KBmiro_dietiker
#28 simplenews-1169990-improve-usability-and-information-28.patch15.28 KBAnushka-mp
#28 simplenews-1169990-improve-usability-and-information-28-interdiff.txt6.75 KBAnushka-mp
#25 simplenews-1169990-improve-usability-and-information-25.patch9.17 KBAnushka-mp
#25 simplenews-1169990-improve-usability-and-information-25-interdiff.txt4.37 KBAnushka-mp
#23 Screen Shot 2015-01-23 at 12.01.50.png44.32 KBAnushka-mp
#22 simplenews-1169990-improve-usability-and-information-21.patch8.61 KBAnushka-mp
#22 simplenews-1169990-improve-usability-and-information-21-interdiff.txt1.1 KBAnushka-mp
#19 simplenews-1169990-improve-usability-and-information-19.patch8.56 KBAnushka-mp
#19 simplenews-1169990-improve-usability-and-information-19-interdiff.txt4.58 KBAnushka-mp
#15 simplenews-1169990-improve-usability-and-information-15.patch7.08 KBAnushka-mp
#15 simplenews-1169990-improve-usability-and-information-15-interdiff.txt2.81 KBAnushka-mp
#15 Screen Shot 2015-01-22 at 17.23.35.png31.44 KBAnushka-mp
#15 Screen Shot 2015-01-22 at 17.23.07.png38.28 KBAnushka-mp
#14 Screen Shot 2015-01-22 at 16.40.20.png59.54 KBAnushka-mp
#14 simplenews-1169990-improve-usability-and-information-14.patch5.5 KBAnushka-mp
#10 snews.png14.81 KBbroon
#10 snews2.png16.13 KBbroon
#6 myImage.png92.14 KBberdir
#1 simplenews_unpublished_not_sent.png11.93 KBberdir
#1 simplenews_published_not_sent.png10.09 KBberdir
#1 simplenews_sent.png4.08 KBberdir
#1 simplenews_set_test_mail_address.png15.83 KBberdir

Comments

berdir’s picture

Title: View Mailing and send test mail after send » Improve usability and displayed information on the newsletter tab
Issue tags: +Needs usability review
StatusFileSize
new15.83 KB
new4.08 KB
new10.09 KB
new11.93 KB

This sounds useful and simple enough.

The newsletter tab currently displays a weird disabled, checked checkbox if sending has started/finished.

I imagine we could re-design the UI of the whole tab a bit. I'll try to get some input from our UX masters, posting some screenshots for them. (Updating title as well)

Note that the screenshots are with the patch from #497108: Send newsletter when node is published applied. and we should get that one in before working on this to avoid unecessary conflicts.

Some thoughts/goals (mainly for outsiders):

- For published nodes, we want to give users the possibility to send a a test mail (if the option is enabled, they can override the test mail address) and initiate sending of the newsletter
- sending will, depending on another global configuration either send immediately or just add them to a queue (called mail spool in simplenews)
- As a result, it would be useful to display that information to users directly.
- unpublished nodes have the option to initiate sending automatically when being published.
- We're not sure if sending should be possible at all if the node is unpublished, see linked issue above. So we could maybe use the same "send newletter" (however it's called and described finally) and just state that it will only be sent once the node is published
- Once sent, it would be useful to see some statistics/progress information. For example, while still being sent it would be useful to see how many mails have already been sent and how many still need to be sent. May be even with a progress bar but I'm not sure how important that is, a simple 140 / 1000 (14%) might be enough for now. Once finished, we just need to display how many mails were sent.
- It should also still be possible to send a test mail during/after the sending process.

yoroy’s picture

Oh, we'd like to use the 'needs usability review' only for big 'controversial' stuff. 'Usability' is the catch-all tag :)

berdir’s picture

Ah, didn't know that about the tags :)

#1169990: Improve usability and displayed information on the newsletter tab is about adding a "Stop sending" button to this tab, I think it makes sense to keep that as a separate issue.

miro_dietiker’s picture

Sending a test newsletter AFTER a newsletter is sent is a common requirement.

About "We're not sure if sending should be possible at all ...", i'm quite sure.
For the future caching support, the system will allow to switch to the recipient user and render the node completely for that specific user. A regular (non-admin) will simply receive a message like "access denied" or no content if the node is not published. Because the recipient actually is not in the allowed state to see the content, also fallback links like "if you don't see this message click here" won't work ever - so we'll spam the world with broken links. Bad.
Thus unpublished nodes should not be allowed to be sent.

About "either send immediately"... note that all outgoing (mass) mails go through the spool table to make us survive timeouts. Only single mails are allowed to be sent immediately. I think we should stay with that pattern.

Note also that there are other modules extending simplenews that possibly will add some data here.
- Visualize sending queue (click through) / Sending progress bar
- Display bounce codes per failed recipient
- Display click response per newsletter recipient
- Content link checker to extract/analyze links in the newsletter and avoid broken links
- Delayed sending date of the send action
- Analytics widget about response statistics
- Button to send (already sent!) newsletter to new newsletter subscribers since the original sending... (e.g. based on subscription date, not necessarily the full receiver history.)
- whatever custom code does here and makes sense...

miro_dietiker’s picture

Issue tags: +test candidate

Oops, correct tagging.

Related to
#289068: Stop sending action on newsletter overview

berdir’s picture

StatusFileSize
new92.14 KB

A simple mockup, thinking about the UI for this.

Just some ideas... see comments in the file.

berdir’s picture

Assigned: Unassigned » corvus_ch
broon’s picture

This is the closest to what I am looking. In 6.x version there was an overview of all issues along with the spooling status (e.g. "2000/3000 newsletter sent"). I am looking for that information in the 7.x version but to no avail. Did I miss that or is it simply not present anymore?
If the latter is correct, I'd suggest to include that information for the newsletter tab.

berdir’s picture

You can find that on the Newsletters tab below Content.

broon’s picture

Ok, I am not seeing the wood for the trees, could you please give the last part of the url?
When viewing the newsletter content and clicking the newsletter tab, I get what you see in screenshot 1.
On the configure pages (newsletters tab) I see screenshot 2.

NOTICE: My image descriptions have not been saved and I can't edit them no more. snews.png is "Screenshot 1" while snews2.png is "Screenshot 2".

berdir’s picture

admin/content/simplenews

broon’s picture

Thanks a lot, I totally missed that tab there.

miro_dietiker’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Assigned: corvus_ch » Unassigned
Issue summary: View changes
Issue tags: +8.x release target

Promoting this to 8.x.

Note that we have meanwhile the "Stop sending" button. :-)

Anushka-mp’s picture

Status: Active » Needs review
StatusFileSize
new5.5 KB
new59.54 KB

As Berdir suggested in #6, the radios are removed now, instead two fieldsets added (see screenshot).
First attempt.submitting for a review.

Anushka-mp’s picture

sent message and pending message modified (see screenshots)
The pending count and sent count added.
awaiting feedback.
Working on tests meanwhile.

berdir’s picture

Status: Needs review » Needs work
+++ b/src/Form/NodeTabForm.php
@@ -232,7 +222,10 @@ class NodeTabForm extends FormBase {
-    if ($values['send'] == SIMPLENEWS_COMMAND_SEND_NOW) {
+    if($trigger['#name'] == 'send_test'){
+      simplenews_send_test($node, $form_state->get('test_addresses'));
+    }
+    if ($node->isPublished() && $trigger['#name'] == 'send_now') {
       simplenews_add_node_to_spool($node);

I would recommend to make separate submit buttons, instead of this. Should become easier to read. three submit buttons, for test send, send now and send published, change submit callback dynamically on the send button.

Anushka-mp’s picture

Separate submit methods added for each submit button. send newsletter submit button dynamically calls the submit handlers.

miro_dietiker’s picture

Status: Needs review » Needs work

As discussed:
Field set to "Send" only.
The second message "Send newsletter to ..." to the exact version from the mockup.

And we miss the dynamic confic check and statement depending on it:
- Mails will be sent immediately.
- Mails will be sent during cron runs.

Anushka-mp’s picture

UI improved as discussed with Miro.

Anushka-mp’s picture

StatusFileSize
new44.32 KB

forgot to add this in #22

Status: Needs review » Needs work
Anushka-mp’s picture

Message in the send field improved a bit. suggested as Berdir
did minor refactoring and ordering of elements.

Status: Needs review » Needs work
miro_dietiker’s picture

+++ b/src/Form/NodeTabForm.php
@@ -127,28 +106,55 @@ class NodeTabForm extends FormBase {
+        $send_text .= ' after the newsletter is published.';

Missing t() here. Add a full sentence like: "Sending is delayed until node is published."

We might need fixed tests. ;-)

Anushka-mp’s picture

Tests corrected. Message in send changed. ;)

miro_dietiker’s picture

Nice work.

Reordering the tab a bit. Splitting sentences into different form elements and switching from title to markup.
And still found some code style issues. Please always check codestyle before uploading a patch.

Providing new version. Dunno if tests pass.
However, the new logic for count, cron/immediate and published text seems totally untested.
This is important information and needs tests.

miro_dietiker’s picture

Status: Needs review » Needs work

Test coverage missing. Thus switching back to needs work.

Anushka-mp’s picture

Status: Needs work » Needs review
StatusFileSize
new2.51 KB
new16.33 KB

Tests are already there for sending the actual and test mails, testing messages and UI.
I just changed the existing tets according to the changes made to the UI.
providing some fixed and admin theme added to the newsletter page with this patch.

Anushka-mp’s picture

StatusFileSize
new126 KB

and this is how it looks like (with the scheduler).

Status: Needs review » Needs work

The last submitted patch, 31: simplenews_1169990_tab_31.patch, failed testing.

miro_dietiker’s picture

The screens look nice. Almost perfect.
However, note that we send ISSUES, not newsletters. So the buttons need to be extended by ..." Issue".

Anushka-mp’s picture

The button texts changed.

Anushka-mp’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 35: simplenews_1169990_tab_33.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 35: simplenews_1169990_tab_33.patch, failed testing.

Anushka-mp’s picture

Status: Needs work » Needs review
StatusFileSize
new3.49 KB
new16.39 KB

Button text change caused the test failures. Tests fixed accordingly.

miro_dietiker’s picture

Status: Needs review » Needs work
+++ b/src/Form/NodeTabForm.php
@@ -120,43 +102,59 @@ class NodeTabForm extends FormBase {
+      if (!$config->get('mail.use_cron')) {
+        $send_text = t('Send newsletter to @count subscribers. Mails will be sent immediately.', array('@count' => $subscriber_count));
+      }
+      else {
+        $send_text = t('Send newsletter to @count subscribers. Mails will be sent when cron runs.', array('@count' => $subscriber_count));
+      }
+      if(!$node->isPublished()){
+        $send_text .= t('Sending is delayed until node is published.');
       }

I have provided a patch at #29 that contains an improvement to these texts and item structure. Already in #31 u didn't work on top of it. Namely use separate form items. Please merge it with your work.

  1. +++ b/src/Form/NodeTabForm.php
    @@ -120,43 +102,59 @@ class NodeTabForm extends FormBase {
    +      $form['send']['send_button'] = array(
    +        '#type' => 'submit',
    +        '#button_type' => 'primary',
    +        '#value' => t('Send newsletter issue'),
    +        '#name' => 'send_now',
    +        '#submit' => $node->isPublished() ? array('::submitSendNow') : array('::submitSendLater'),
    +      );
    

    Split this into two buttons with if / else.
    button: send_now with #value "Send now"
    button: send_on_publish with #value "Send on publish"
    As a result, drop the extra text "...delayed until node is published." above.

  2. +++ b/src/Form/NodeTabForm.php
    @@ -229,29 +227,50 @@ class NodeTabForm extends FormBase {
    +      drupal_set_message(t('Newsletter %title sent.', array('%title' => $node->getTitle())));
    ...
    +      drupal_set_message(t('Newsletter %title pending.', array('%title' => $node->getTitle())));
    

    +issue :-)

  3. +++ b/src/Form/NodeTabForm.php
    @@ -229,29 +227,50 @@ class NodeTabForm extends FormBase {
    +    $node->simplenews_issue->status = SIMPLENEWS_STATUS_SEND_PUBLISH;
         $node->save();
    

    I guess we should add a message here "Newsletter issue %title will be sent when published."

+ Berdir will check and provide more feedback.

Anushka-mp’s picture

Status: Needs work » Needs review
StatusFileSize
new8.32 KB
new20.27 KB

Reworked on Miro's earlier changes and above comment.

Status: Needs review » Needs work

The last submitted patch, 42: simplenews_1169990_tab_42.patch, failed testing.

Anushka-mp’s picture

Status: Needs work » Needs review
StatusFileSize
new20.23 KB

As discussed with Berdir.
Minor UI fixes.

Anushka-mp’s picture

Send button declared separately for published and unpublished status of the newsletter.
As discussed with Berdir.
(interdiff against #29 added)

berdir’s picture

Some cleanup.

  • Berdir committed 2f23b95 on authored by Anushka-mp
    Issue #1169990 by Anushka-mp, Berdir, miro_dietiker: Improve usability...
berdir’s picture

Status: Needs review » Fixed

Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.