Needs work
Project:
Simplenews
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Apr 2012 at 09:14 UTC
Updated:
17 Jan 2025 at 10:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
marislazda commentedsomeone?
Comment #2
berdirThis is currently not supported. Changing to a feature request.
Comment #3
alberto56 commentedIn the current behaviour, nodes which are in a given language but not part of a translation set are considered just like a node with no language: they are sent to everyone.
This might not be ideal because you might have a situation where:
(1) A first node is created in French, and not part of a translation set
(2) The first node is queued for sending
(3) Cron runs, the node is sent to English and French subscribers
(4) A translated node is created in English and queued for sending
(5) Cron runs, and now the English node is sent to English subscribers, and the French node to French subscribers (even though they already got it).
This patch allows administrators to bypass the translation set logic entirely if required. (See image.)
This patch also provides another feature requested by marislazda, above, which requires nodes to be LANGUAGE_NONE or in a subscriber's preferred language before being sent. This will prevent nodes from being sent out to users who can't understand them, regardless of translation sets (in fact the translation module is not required for this at all).
See enclosed patch and screenshot
New simpletests are not included, though.
Comment #4
alberto56 commentedOops here is the screenshot.
Comment #5
alberto56 commentedI am periodically getting a "status cannot be null" integrity constraint violation, in this call in simplenews.mail.inc:
Not sure if it is related to this patch though. Documenting it here in case some else gets it as well.
Comment #6
nikita.izotov commentedAfter patching i have this error after sending the newsletter out:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'status' cannot be null: UPDATE {simplenews_mail_spool} SET status=:db_update_placeholder_0, error=:db_update_placeholder_1, timestamp=:db_update_placeholder_2 WHERE (msid IN (:db_condition_placeholder_0)) ; Array ( [:db_update_placeholder_0] => [:db_update_placeholder_1] => 0 [:db_update_placeholder_2] => 1485254479 [:db_condition_placeholder_0] => 61 ) funktsioonis simplenews_update_spool() (rida 476 / /home/www/prod/sites/default/modules/contrib/simplenews/includes/simplenews.mail.inc).
Comment #7
nikita.izotov commentedSQL problem solved, this wasn't caused by this patch, but I found that simplenews will send newsletter nodes if they are not published.
How to do:
1. Create newsletter node, save and publish it.
2. Translate newsletter node, save without publishing,
What will happen:
Drupal will send original node what is published and not published translation.
To fix that i've created a small patch that is attached.
Comment #8
luksakProbably this is not going to make it into 7.x anymore and AFAIK this is not implemented in 3.x. Therefore moving this to 3.x.
Comment #9
luksakComment #10
luksakI am gong to try to implement this. How should we approach this?
RecipientHandlerSelectBasebuilds the query, should it handle this logic as well or should we create a newRecipientHandlerfor this?https://git.drupalcode.org/project/simplenews/-/blob/3.x/src/Plugin/simp...
Comment #12
luksakThe merge request introduces a new
RecipientHandlercalledRecipientHandlerTranslationRestrictedthat supports sending newsletter issues only to subscribers with the preferred language matching an existing translation of the issue.I have no idea why there would be a merge conflict since the branch has the latest commits from 3.x. Could someone else have a look at this?
Comment #13
adamps commentedComment #15
omarlopesinoThe MR works fine into my site (Drupal 11). I've updated the MR thinking that the MR needs reroll, but i guess it is for the D7 patch, not the MR.
I've noticed that for example, when I create a newsletter issue, and I send it, if I create a translation, I can't send the translation of that content. This implies that if I want to send a newsletter in multiple languages, I need to create every translation before sending it.
Could it be good idea to re-queue the newsletter when a translation is created?
Comment #17
adamps commentedThanks. Fixes now need to be on 4.x.
This is "works as designed". Each newsletter can only be sent once - otherwise it causes many problems for this module.