Closed (fixed)
Project:
Simplenews
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2023 at 21:26 UTC
Updated:
21 Jan 2024 at 17:24 UTC
Jump to comment: Most recent
It's not immediately clear how to send a newsletter, after creating it.
Some users manage to find the "Newsletter issues" (/admin/content/simplenews) list, but there actually is a slightly hidden tab right above the newsletter, after "Edit".
"Newsletter Issue [...] has been created. Preview or send it via the Newsletter tab, administer under Newsletter issues.
- Create a newsletter via "Add content" > "Newsletter"
- Preview and send via the "Newsletter" tab next to "Edit"
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
adamps commented"Newsletter issues" is not the easiest way to send the newsletter.
After creating a newsletter node, then normally you are redirected to the page for viewing the node. You should see "tabs" for actions: View, Edit, Delete, and Newsletter. That's the easiest way to send.
Comment #3
ressaThanks for clarifying, I totally missed that "Newsletter" tab ... It's greyed out, and just a faint element among many other elements ...
View | Edit | Newsletter | Delete | Revisions | DevelI am probably not the only one to miss it, so maybe we can clarify how to send it, by adding a help text, after creating a newsletter?
Also, what do you think about my suggestion about adding the fewest basic steps required to create and send a newsletter in the README?
I have updated the Issue Summary with my suggested solutions for both issues.
Comment #4
ressaComment #5
ressaComment #7
ressaI created a MR, adding a "Quick Start" section at the very top. The README needs a thorough rewrite after the changes in
4.x, and also a Markdown massage. But that will take too long, so I'll keep the focus on getting new users on-boarded faster in this issue.Even though
3.xis the currently recommended version, perhaps the default Gitlab branch could be considered to get updated to4.x, for easier MR creation, since that's where the current development is taking place?Comment #8
ressaPS. It currently says "Add content" > "Newsletter Issue" ... could that get trimmed down to just "Newsletter"?
Comment #9
ressaComment #10
adamps commentedActually it takes too long (of my time) to keep making small changes, so let's do the job properly or not at all. There is already another issue for README updates (including markdown) so please can you add your changes to that?
Yes I would like to, but unfortunately I don't have permissions. It would need one of the other maintainers to do it.
Comment #11
ressaI totally understand and agree, let's be efficient: I have updated the README, please review.
What do you think about "Proposed resolution" #1, about adding link to the "Send newsletter" tab, after creation? I think that would make the most difference by far, in terms of helping new users get started.
Comment #12
adamps commentedYes it's a good idea. The link should only be shown if the user has permission to send.
Comment #15
ressaHere's an attempt at adding the link above a newsletter, and only show if the user has administer or send newsletter permission.
Comment #16
adamps commentedGreat thanks I made some comments in the MR to tidy up a little
Comment #17
ressaThanks for a fast review, I have attempted to update the MR.
I have kept the admin link, since I think it's a killer feature, which may easily get overlooked. So adding four words ("administer under Newsletter issues") in the big scheme of things is all right, I would think.
Comment #18
ressaThe test is failing, I am not sure why ...
At least I discovered DDEV with Selenium Standalone Chrome in the process :)
Comment #19
ressaThe problem is that the function gets declared again after a Preview:
Fatal error: Cannot redeclare simplenews_form_node_submit() (previously declared in /var/www/html/web/modules/contrib/simplenews/simplenews.module:314) in /var/www/html/web/modules/contrib/simplenews/simplenews.module on line 314It's these steps of the test, from
/simplenews/tests/src/Functional/SimplenewsSendTest.php:I tried different solutions, which either didn't work, or caused many other tests to fail ... so a little assistance is probably needed to make this work. Thanks!
Comment #20
adamps commentedGreat it's nearly there now.
This issue is a balance as the experienced users might find the message annoying when it's already obvious to them - the tab isn't really so invisible maybe that's just your theme😃. However I have sympathy with the new users, and after creating a newsletter it's very natural to send it, and so I agree to your request, as it says in the issue title.
However the admin link is different. Admin doesn't follow naturally from creating a newsletter - the site owner will likely send 100 newsletters but admin only once. The person who creates a newsletter is often not even the same person as the admin.
We have the help system, and the configure link in the info file - these are the standard places that people should look when getting started with the module.
Comment #21
adamps commentedThat's very strange! How can that function be redeclared but the rest of the file not? I would just try to experiment, for example, what if you change the function name, move it to a different place in the file or a different file etc.?
Comment #22
ressaThanks for the constructive feedback, it's great to be able to trim down the code.
And phew, this is taxing for me -- new territory :)
Yes, you're right that only some users can administer, that's a good argument -- so let's lose the admin link.
About visibility, I am using Olivero, heh. But I honestly think that if you sat down with a handful of new Simplenews users, that a lot of them would stall at the final "send the newsletter" part.
I see now that the steps are described on the "Create Newsletter Issue" page, at the top, but I usually skip long lines of text, and just crack on with the task ...
Yes, and I did try that and pushed it, but then quickly ran the local PHPUnit test in DDEV, which gave lots of errors, so I reverted it. But now I see the test completed with no errors on Gitlab (
18 December 2023 at 14:21). Strange.I'll try again with the re-located function, let's see how it goes.
Also, I almost got the link working with the placeholder, except it's shown as text. If I remove the
->toString()from$newsletter_tab->toString()it complains:TypeError: strpos(): Argument #1 ($haystack) must be of type string, Drupal\Core\Link [...]Do you know how to resolve this?
Comment #23
ressaOk, so moving the function down fixes the test failure in #19, but causes many other test failures ... I am not sure how to proceed.
Remaining tasks:
Comment #24
berdirGitlab CI test fails are not related, they are currently failing. DrupalCI tests are showing as green.
Comment #25
ressaThanks for the comments @berdir, they were really helpful, just like the ones I got from @AdamPS.
I don't mean to turn this into an issue about tests, but I got to say that they have been a small blessing, but mostly a hurdle. The one I have found useful is this specific test, run like this, using only the https://github.com/ddev/ddev-selenium-standalone-chrome:
ddev exec -d /var/www/html/web "../vendor/bin/phpunit -v -c ./core/phpunit.xml.dist ./modules/contrib/simplenews/tests/src/Functional/SimplenewsSendTest.php"This test caught that my new code broke the "Preview" test, and I could update the code, and verify that the test then passed, which was great
But if I run all tests, I get a lot of failures:
I also tried with https://github.com/ddev/ddev-drupal-contrib, but running a single test like this fails:
If Gitlab CI tests are known to not work, shouldn't they be turned off? From my point of view, this false positive was also not helping me.
I originally got involved with Lando + Drupal Contributions because it offered a turnkey solution for PHPUnit + Nightwatch test. I feel DDEV is very close to that with https://github.com/ddev/ddev-drupal-contrib and/or https://github.com/ddev/ddev-selenium-standalone-chrome, but that a simple piece of the puzzle is missing.
Comment #26
ressaSorry about the test rant, I created Simplenews tests are failing #27 in the DDEV Drupal Contrib issue queue to maybe clear this up.
Comment #27
adamps commentedGreat thanks it looks good. I added one comment.
I would love to have the tests working in GitLab. I spent as much time as I could afford without success. You are right we could disable them, however it would be a backward step, and I was hoping that someone might be able to fix them quite soon.
I believe the failure about monitoring is a different case and it's OK on GitLab. The code currently uses "@dependencies monitoring" which I guess ddev doesn't recognises.
Comment #29
adamps commentedOK I'm about to run the coding standards fixer so I'll catch the unused line as part of that. Thanks everyone.
Comment #30
ressaThanks @AdamPS, I appreciate all the help I got here, great to get this in the module. Have a nice day.