I would like to request integrating the simplenews module with the views module.

Such an integration will allow trimming the number of news announcements shown on a page, and integrating such a report with other display modules, such as panels.

Thanks for any help.

Comments

sutharsan’s picture

I like this too, but it is not on my priority list. Mkmk, what can *you* do to make this happen?

anne-pierre’s picture

Dude mkmk,
You need to do a minimum of research before posting your questions! Check here: http://drupal.org/node/419790. The page is title: How to 'demote' past simplenews newsletter from frontpage using Views 2

anne-pierre’s picture

Dude mkmk,
You need to do a minimum of research before posting your questions! Check here: http://drupal.org/node/419790. The page is title: How to 'demote' past simplenews newsletter from frontpage using Views 2

mkmk’s picture

Priority: Normal » Minor

Anne-Pierre, thanks for the feedback. I had tried to setup views and did not manage to do it. I just tried again and, apparrently, it is possible to filter the view based on taxonomy.

I have to essentially create a view that shows what the built-in view of simplenews provides. I can then use my new view in panels. It's not ideal, but it works.

Thanks a lot.

miro_dietiker’s picture

I would like to add this to the next feature 6.x-2.x release. Since we work a lot with views, i consider prio normal.

Would be great if someone could take the ball to implement the views integration.

EDIT:
Note that full views integration coverage includes:
- Subscriptions (User, List, Active)
- Newsletter issue (sent count)
- Spool (Mails to send / sent per issue or globally)
.. possibly more ...

miro_dietiker’s picture

Version: 6.x-1.0 » 6.x-2.x-dev
Component: Usability » Code
Priority: Minor » Normal
Katrina B’s picture

My issue may be a "duplicate" in the general sense that I am asking for compatibility with Views; however, I am asking for a different kind of functionality than what is described above. I'm not asking to be able to display Simplenews to users with Views; I'm asking for the ability, as admin, to view who is/isn't subscribed, using Views.

miro_dietiker’s picture

miro_dietiker’s picture

Referencing to
#948206: Export to CSV

miro_dietiker’s picture

Assigned: Unassigned » miro_dietiker

We're working on this.

DrupOn’s picture

StatusFileSize
new0 bytes

ignore this post (wrong file uploaded)

DrupOn’s picture

Status: Active » Needs review
StatusFileSize
new38.16 KB

Patch that includes the simplenews.views.inc file for the views integration of this module. Besides that, it does alter the simplenews_mail_spool table, appending the snid foreign key field for a clearer reference to the simplenews_subscriptions table.

miro_dietiker’s picture

Thank you, this is great progress.

Simon could you please review this?
I've already guided the patch creation, second review appreciated.

DrupOn’s picture

Forgot to add snid index in hook_schema().

    'indexes' => array(
...
      'snid' => array('snid'),
simon georges’s picture

Status: Needs review » Needs work

Caution, the current patch creates a simplenews (copy ).views.inc file. Otherwise, it applies cleanly.

Regarding the Views integration itself, what I've tested is working so far (and really great work, relations areall there, it's really good to finally use the Views power to make intuitive Simplenews administration UIs ;)).

I have only a few small remarks:

  • "Subscriber" field could be renamed to Subscriber E-mail, for clarity purpose (I was looking for it at first ;)), and the field itself could be formatted as a mailto: link by default (like the User Email field), but that second part is a nice-to-have
  • What's the difference between Subscription and Subscribers ? On the "Add View" UI, we have
    Simplenews subscriber
    Contains subscribers of Simplenews Newsletters.
    Simplenews subscription
    Contains all Subscriptions of every Simplenews Newsletters.

    Shouldn't we keep only one ? It seems a little bit confusing, especially since subscription stuff is available when listing subscriber.
  • In the nice-to-have department, we could also have direct "action" links to edit the subscriptions (but they can be created using Views power, so do as you have time to)
  • Well, the next step is to provide default Views that could override the default simplenews admin UI screens. Ok, this one is clearly a nice-to-have for the future ;) You put some really solid grounds, I think.

Again, really great work, so much people were waiting for this !

miro_dietiker’s picture

Simon
We had already long discussions with that.

The copy is an oops ;-) sure.

The subscription (subscriptions) is the cross product between newsletter and subscriber.
Since a subscription itself has own data attached (subscription date, active), it also has an own entity.
Every subscriber can have N subscriptions, so we can't say this is the same.

There are clear cases (especially in future evolution) where we need access to this separate table.
One day we even introduce separate id for the subscription in addition to the subscriber id.

Note that as a comparition e.g. node - taxonomy (1:n) was a very bad example. Other better examples appreciated.

Since time is limited we'll go with what we have and limit current work to your input corrections.
Action links and default views will be todo for a next evolutionary step.

Thank you for your review!

simon georges’s picture

In fact, I was just suggesting dropping one of "subscriber" or "subscription" on the "Add Views" screen. Regarding the entities themselves, I totally understand needing both of them. Anyway, everything is working great, so I have no objection at all to have this into the 6.x-2.0 release, we can totally wait to see how user react before changing anything ;)

Again, really great work on this one !

miro_dietiker’s picture

Fixed in CVS.
For 6.x-2.x this needs some more work.
In my committed version i can't add newsletter status field to a node
And i can't join from node to newsletter issue.
I thought this was working some time ago.

I think we should have added newsletter issue (1:0..1) to the node context and not add a new "simplenews issue" entity to views.

I expect some fixes regarding 2.x views integration, but don't consider this views handler stability a release blocker.

miro_dietiker’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Needs work » Patch (to be ported)

Committed new views version to cvs.

Issue is now in context node. (implicit join if a newsletter issue field is added to node)
nid, vid is dropped from node context output (since already present from node).

Ready for D7 again.

miro_dietiker’s picture

Status: Patch (to be ported) » Fixed

committed d7 port to cvs.

DrupOn’s picture

Tables for simplenews are now integrated into views for D7 version as well. Please open new issues if you have any requests concerning views integration.

DrupOn’s picture

Status: Fixed » Closed (fixed)

Closed...