Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would really add a lot of value if this module can be enhanced, so as to expose an Edition Counter [as Tag] to the Newsletter.
This parameter can then be passed as input parameter to an Embedded View, which could in turn use it to select matching Nodes for inclusion.
Use Case: Email Training Course, where each edition contains a different set of 1/more Training Nodes.
Thanks for all the hard work. Much Appreciated!
Comment | File | Size | Author |
---|---|---|---|
#5 | 813948-edition-count-token-2.patch | 4.28 KB | dgtlmoon |
#3 | 813948-edition-count-token.patch | 1.78 KB | dgtlmoon |
Comments
Comment #1
joachim CreditAttribution: joachim commentedThe use case of an email training course seems out of scope here, for the same reasons I give over at #940420: Ability to schedule a relative time.
As for an edition counter, that is something we could make available to the alter hook. Though this feature request is pretty old so I doubt the requester is around any more (and the stop count doesn't work at all on D6 right now...).
Bumping this to D7 anyway, for discussion of its merit and usefulness.
Comment #2
SiteMaster.ServeLime.com CreditAttribution: SiteMaster.ServeLime.com commentedThanks for not forgetting this one :)
Still relevant.
Comment #3
dgtlmoon CreditAttribution: dgtlmoon commentedTry this one.. no test just yet
Comment #4
dgtlmoon CreditAttribution: dgtlmoon commentedComment #5
dgtlmoon CreditAttribution: dgtlmoon commentedRe-queueing with patch for testing
Comment #6
dgtlmoon CreditAttribution: dgtlmoon commentedThis introduces new token [simplenews-scheduler:edition-number]
Comment #7
miro_dietikerA good idea! :-) - And a short review.
Documentation missing: If an edition was deleted after sending during a newsletter lifetime, numbering won't be clean. There will be duplicate "numbers".
I think it's just too much on one line. Wrapping?
Missing a space.
Comment #8
dgtlmoon CreditAttribution: dgtlmoon commented" If an edition was deleted after sending during a newsletter lifetime, numbering won't be clean. There will be duplicate "numbers"."
What do you propose? do a left join and see which nodes still exist at that time?
Comment #9
miro_dietikerI would just clearly document this condition/limitation.
When going through the code i see that the limitation isn't here yet anyway.
#1795674: Rows in simplenews_scheduler_editions getting orphaned
It never deletes any rows. We could avoid that limitation by persisting the simplenews_scheduler_editions for as long as the scheduled newsletter exists.
Alternatively we could also persist a counter column in the simplenews_scheduler table. We would then have no dependency to previous simplenews_scheduler_editions rows.
Advanced users might need a custom edition definition anyway:
Monthly edition creators wouldn't care about absolute numbers, but more about an YYYY-MM notation.
This can e.g. be built with rules.
Comment #10
dgtlmoon CreditAttribution: dgtlmoon commentedyou're making it complicated about what people should do/can do that is not the original request for this function, but yes, maybe even a simple variable_set('simplenews_scheduler_editions_set_'.$nid, $n++); could be enough
Comment #11
miro_dietikerI just wanted to warn you about the side effects :-)
Using variables is possibly the worst solution but would work...
I'm perfectly fine with putting the code as-is into the repo, if you add documentation about the limitation. Maybe for some it's no limitation but even a feature!
Comment #12
dgtlmoon CreditAttribution: dgtlmoon commentedI think a warning in with the token description might be a good too