Closed (fixed)
Project:
Simplenews
Version:
3.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2023 at 14:28 UTC
Updated:
28 Apr 2023 at 09:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nofue commentedComment #3
avpadernoComment #4
philsward commentedThinking I've run into the same issue. Stopping doesn't seem to work as expected?
Comment #5
adamps commentedIt works for me. This needs a clear "steps to reproduce" for me to be able to work on it please.
Comment #6
philsward commented@AdamPS I don't know what to tell you for steps. It's pretty straight forward. Stop sending a news letter so you can re-send it and it acts like it doesn't stop because re-sending never works.
The "Send Status" icon never changes from the green checkmark when stopping.
Like nofue mentioned, selecting the news letter, choosing Stop sending and apply to selected items does refresh the page, however it never changes the "Send Status" icon. Thus, turning around and re-selecting the same newsletter and choosing "Send newsletter issue" acts like it works, but no newsletters are actually sent.
For me, simplenews 3.x-dev is completely worthless in my environment. It was upgraded from the 2.x-dev branch which worked just fine.
Environment is PHP 8.0.28
Comment #7
nofue commented@AdamPS
Here's the step by step you requested:
1.) Create a newsletter
2.) Set the node to 'unpublished'
3.) click the newsletter tab
4.) click "send"
Now the newsletter is in "sending state" (message reads something like "will be sent once published") and it's impossible (at least for me) to "stop sending" in this state. It's also impossible to edit that newsletter, because it is in the sending state.
Workaround, as stated above:
1.) Make sure your machine cannot send messages (f.e. changing settings in the mail transport module -- I set the transport method to some not working transport, like SMTP without proper credentials. If your cron is running only once in a while, you should have plenty of time for the following steps anyway)
2.) Publish the node
3.) Now you can "stop sending"
4.) revert the changed transport settings (or whatever you did to keep simplenews from sending the newsletter)
5.) Edit along merrily.
@philsward -- I cannot agree with your observation. I have simplenews/symfony mailer on (at least) six installations doing a marvellous job. It took me a weekend to get the first site going, but that's long done. The six sites have sent at least 20 news-issues to a total of more than 15000 receivers. So it's far from "unusable" for me, to the contrary, it's the best simplenews/mailer combo ever.
Comment #8
adamps commentedGreat thanks I see it now. I was missing step 2 "unpublished" - which I agree was mentioned, however it's much easier to see with "steps to reproduce"😃. Let's make the title more obvious too.
Comment #9
adamps commentedComment #11
adamps commentedThe test was wrong - it checked for the same wrong result that the old code generated.
Comment #12
philsward commentedEven with the patch, I am unable to use the "Stop Sending" functionality.
@AdamPS I'm sure the module works great in your environment, but I'm saying it doesn't work in mine.
For my workflow, I don't create a new newsletter for every issue, I re-use the same newsletter. All of the info in the newsletter is dynamically created through a View on a daily basis based on the content of the site so there's no reason for me to have to create a new newsletter and send it off like a "normal" workflow might dictate.
In the past, I simply stopped sending, then did a Send Newsletter which would trigger the same newsletter to send again. This unfortunately isn't working now.
Like I stated before, v2 would show a clock while sending. Successfully finished would show the checkmark. I think stop sending would remove the icons completely? v3 on the other-hand shows the checkmark for successfully sending all of the newsletters but stop sending does not remove this checkmark making it act like it never stops sending. Attempting a re-send doesn't ever send anything making it feel like stop sending isn't actually working. Visually, it certainly doesn't "look" like it stops sending.
Comment #13
philsward commentedUpdate:
I'm not a coder, but sometimes I can find a piece to a puzzle.
This was changed in the patch:
I added the status to the + line:
Which makes:
Whether it's right or not, I don't know, however stopping the send "appears" to work.
I can't get the emails to actually fire off yet which may be another issue altogether, but at least adding the SEND_READY to that line makes the stopping appear to do what it's supposed to.
Comment #14
philsward commentedFrom what I can gather, Drupal isn't setting the correct "from" address and due to DMARC my server is blocking it.
So yes, the email not sending is on my end. However, checking past attempts with SimpleNews to stop and start the message, it did not actually attempt to send the message until after I added the SIMPLENEWS_STATUS_SEND_READY bits.
Hope this is confirmable and not a random freak coincidence.
Update: Figured out the mail issue for anyone curious... In mail system I had SimpleNews set to use Mime Mail. For whatever reason, mimemail doesn't appear to respect the "From:" setting. I changed the mail system setting for the added SimpleNews module to use SwiftMailer instead and it went through.
Comment #15
adamps commentedThis is not something that's intended to work - reusing newsletters is not currently supported and once the newsletter has finished sending, then the stop sending button should no longer be present. There is a feature request for it #3056037: Allow resending of newsletters to specific recipients. Or maybe this module could help you but I haven't tested it: https://www.drupal.org/project/simplenews_resend.
This issue is for a specific problem with the steps in #7. If have problems with a different set of steps then please use a different issue.
Comment #16
philsward commentedI'm confused though... This worked fine on v2 but it's being stripped from v3?
So all that is needed to fix #3056037: Allow resending of newsletters to specific recipients is to add SIMPLENEWS_STATUS_SEND_READY in the area mentioned above?
I'm not sure why the separate module is needed when this is already present in simplenews it's just not enabled?
After making the fix suggested above, it works exactly like v2 and I imagine it does exactly the same thing as the resend module.
As a worst case, wouldn't it make sense to put a checkbox setting in the simplenews settings for "Allow resending of Issues" and show/hide the stop send based on that setting? It would be one less module to have to keep track of and I would imagine a lot less actual code overhead.
But what do I know. I'm just the guy trying to use it.
Comment #17
adamps commentedThe code was changed in #3052727: Create clear consolidated functions to send/cancel newsletters. I don't really agree it "worked fine" in v2. The purpose of the "Stop sending" button is to stop sending any more emails. Most commonly it would be used before any were sent; it could also be used to abort part way, but then it's not really possible to continue sending as there is no record of who to resend to. Once the newsletter has been sent, it's no longer possible to stop sending, hence the button is should longer be shown. You were using "Stop sending" to reset the newsletter so you could send it again. It is random chance that it worked in that way - it was not logical nor was it the intention.
For #3056037: Allow resending of newsletters to specific recipients, the button should be named "Reset". It should likely reset the statistics. There is a very real danger of sending the same newsletter to the same people, which would tend to be called spam. So maybe it should only work if you reset the newsletter content at the same time (which I guess, you would be happy to do). At minimum there should be a clear warning of the dangers.
It seems to me that creating a new newsletter is not so hard. It has the advantage that you get a clear history of when you sent out newsletters and how many people it was sent to.
Comment #18
nofue commented@philsward : My solution "to your problem" (at least in part) was to create a new content type "canned news" where I put all the content I wanted to resend into the template fields. So whenever I create a new newsletter of type "canned_news", everything is already in place, and if there are changes, like a different date or such, it's an easy task to change that in a second. Hope this helps your use of s/m.
Comment #19
philsward commented@AdamPS
This does make more sense. For now I'll just use the work-around until it gets stripped completely, then take a look at the resend module you suggested.
I guess make a note that there is "some" demand for the need to resend an existing issue so building it into simplenews might be warranted.
I'll drop off the convo since there shouldn't be anything else on my end to discuss ;-)
Comment #20
adamps commented@nofue If you can confirm the patch solves your problem then I will commit the fix
@philsward 😃 Could also be worth a look at https://www.drupal.org/project/simplenews_resend
Comment #21
nofue commentedAs I put the last evaluation site online, I have to begin testing simplenews on my newest site earlier than expected. I'll try to have the subscription part ready soon, then run some tests in a clear environment, also playing with transport modes to close some of my blind spots before getting my hands to that part of the tutorial/manual …
Comment #22
nofue commentedYup, works for me.
Actually, there was that newsletter still stuck from my initial request, and after applying the patch, it became immediately available for editing again.
However, your request sent me into some hoops … A crash course in "how to apply patches using composer", plus a heads up to "do not edit a composer.json on one site while hoping for things to happen in another". Oh, well. You made my Saturday ;)
One more thing off the list -- thanks to everybody involved.
Comment #23
nofue commented@philsward:
Have you made composer requiring the .dev version of simplenews? I.e.
composer require 'drupal/simplenews:3.x-dev'The patch won't work for …-beta4
Comment #25
adamps commentedGreat thanks for the confirmation. New release coming soon.