Author Topic: new inbox view?  (Read 4304 times)

Offline wendy

  • Newbie
  • *
  • Posts: 8
new inbox view?
« on: August 30, 2010, 09:56:10 AM »
Can anyone tell me if the following is possible, and possibly give me a shove in the right direction?

I need to integrate roundcube with an existing program, and so far everything is working really nicely (I've had more trouble with the existing program than with roundcube :)

Last thing I need is to be able to show a custom list of email messages outside of the usual roundcube page:

imagine a screen with lots of information about a particular client at the top of the page, where I want to show a list of all emails associated with that client at the bottom part of the screen. The list of emails I want to show on any particular will be gotten from the messages table, where I check the from/to addresses against the client's email address.

It would also be great if I could then click on one of these emails and they would open up (so something like the 'preview' view on inboxes used in roundcube)

As far as I can see I have two options here:

1) get the information directly from the messages table, and ignore roundcube and try and piece everything together myself - this seems a bit like re-inventing the wheel though

2) open roundcube in a frame at the bottom of the page, but instead of showing the usual inbox I would need to somehow customize it to get rid of the headers, the left sidebar, and only show relevant messages.

I would *not* need to be able to send/receive new email from here, only display messages that are already in the 'messages' table that satisfy certain conditions.

Is there an easy way to make a new template with a new 'inbox' view, similar to the current inbox view and open that in a new iframe?

Any advice, hints, other options, and even telling me I should stick to 1) as 2) would be absolutely impossible would be greatly appreciated!

Thanks!
Wendy

Offline wendy

  • Newbie
  • *
  • Posts: 8
new inbox view?
« Reply #1 on: August 30, 2010, 10:21:29 AM »
Thinking about this some more, I think the most elegant solution (if possible) would be if I could show a roundcube mailbox frame, get rid of the headers/sidebar and pass it a list of message IDs that I want displayed in the list.

So problem 1:
Instead of displaying a list of messages in one of the mailboxes in the sidebar, I want to specify this list myself.

and problem 2:
Change the look of the page to just the inbox, but this might be very easily done using templates?

Possible? Impossible? Maybe-possible? :)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
new inbox view?
« Reply #2 on: August 30, 2010, 10:32:02 AM »
Option #1 isn't a great idea because email headers are only cached in the message table when the email is read/loaded in RoundCube so if a new email comes in and RoundCube hasn't been opened it wouldn't show up. That said it depends on where the email are and witch type of emails you want are. So for some quick questions:
  • Are they all in one folder or are in multiple folders?
  • Do you want all the emails from a certain person or also the email sent to them?
  • Are all the emails in one email account or are they in multiple accounts?

And just a idea about option#2 you could make a RoundCube plugin that would get the emails that you wanted and have it make a rss feed that you could then display on your website.

Offline wendy

  • Newbie
  • *
  • Posts: 8
new inbox view?
« Reply #3 on: August 30, 2010, 11:01:14 AM »
Thanks for your response!

Quote from: skaero;29756
Option #1 isn't a great idea because email headers are only cached in the message table when the email is read/loaded in RoundCube so if a new email comes in and RoundCube hasn't been opened it wouldn't show up. That said it depends on where the email are and witch type of emails you want are.


It is not really important if only emails that have been opened in roundcube are displayed, would be nice if new emails were also shown, but not absolutely vital.

Quote

So for some quick questions:
  • Are they all in one folder or are in multiple folders?


They will probably be in multiple folders: either I want the emails in all folders, or I will restrict it to a single folder with a particular name

Quote

  • Do you want all the emails from a certain person or also the email sent to them?


I want to be able to display emails sent to address x or received from address x. A page should give information about a particular client to the company, and as part of that I want to show all emails sent to that client or received from that client. These emails should be taken from multiple accounts.

So I had in mind some sort of select query on the messages table where I say user_id IN (some array of allowed user ids) and (from like 'email' or to like 'email')

Quote

  • Are all the emails in one email account or are they in multiple accounts?



They come from multiple accounts, but I'll have a list of allowed user_ids where they could be coming from

Quote

And just a idea about option#2 you could make a RoundCube plugin that would get the emails that you wanted and have it make a rss feed that you could then display on your website.


I like that idea, but then I wouldn't be able to display the actual messages would I?

I've been digging some more into the roundcube templates and am slowly getting a better idea of how things work (but still a far way off..). I see the mail.html template file looks like the one I want, except that I would copy it into a new file and change it slightly. That gives me a nice new template, but then how do I actually use that template? Say I have a very simple template called test.html, which simply outputs "hello world", how would I link to a page that displays that?

I have also found the tag, which if I understand correctly displays the list of messages for a particular mailbox - so is that what I would use to display my list of messages? or can't I use that because I want a custom list?

Sorry, just trying to get my head around things! There is a lot roundcube can do, which is great, but it takes a little time to understand :)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
new inbox view?
« Reply #4 on: August 30, 2010, 11:11:37 AM »
Well you have one main problem that will stop you from using option #2 witch is the fact that RoundCube can only connect to one imap account at a time witch would make it imposable to read the mail from more then one account. So here is one more question, is this a new email system or a exciting email system with a lot of emails already in it?

Offline wendy

  • Newbie
  • *
  • Posts: 8
new inbox view?
« Reply #5 on: August 30, 2010, 11:16:20 AM »
It's a remake of an existing system, so there are already emails in there, but I think we're going to ignore those anyway.

I was hoping by using the messages table that I could at least get the headers for all different mailboxes, and then when I click on one of the header to show the message itself it would only have to connect to that 1 account?

But that might be optimistic..

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
new inbox view?
« Reply #6 on: August 30, 2010, 11:36:20 AM »
The caching implementation in RoundCube isn't great and I think you'd find that your missing a lot of emails if you relied upon it. I think the best way to do it would be a custom imap connection and imap search outside of RoundCube because all of the solutions I can think of with RoundCube would have lots of missing emails.

Offline wendy

  • Newbie
  • *
  • Posts: 8
new inbox view?
« Reply #7 on: August 30, 2010, 11:40:28 AM »
Ok, thank you very much, I'll try a non-roundcube solution first then and see how that goes.

Thanks for your time!