Hello there,
I wonder if it is possible to use mailhandler to create entries for specified organic groups. if so, what's the correct syntax for that?
If that's not possible, I would like to request that as a new feature to be developed.
Best,
Leo Burd
Comments
Comment #1
samo commentedI imagine it could be as easy as:
og_groups: [gid]
On a related note, I have made a number of changes to a site I am working on, www.academiccommons.org, to allow for Yahoo group-like functionality. I have made fairly heavy modifications to og.module, mailhandler.module, comment.module, upload.module, and listhandler.module. I would like to share these contributions as best I can but making them generally suitable will take a fair bit of work. Is this functionality that others are interested in?
To start, I added a new og field "mailing_list". All incoming mail is forwarded to a mailhandler box. The og_group is associated via this og mailing_list field. Threads can be started via the web or via email. Attachments are allowed for both the main node and the subsequent comments. I handle HTML mail with the activeMailLib currently contained in the mail module.
Any interest from others in similar functionality? Any ideas as to where to start with patches?
Comment #2
moshe weitzman commentedyes, og wants to service groups curently being serviced by yahoo gruops. patches welcome.
to create nodes via mailhandler, you have to send the required fields using the Command syntax. See the help for mailhandler. a group is just a node
Comment #3
samo commentedI will do my best to provide decent patches, but I worry that I have gone too far off-course with mods to some of these modules.
Here are some changes and assumptions I made that I could use feedback on:
1) I only use one mailhandler box instead of one per og.
2) I associate a mailhandler post with an og via the _mailhandler hook.
3) I modified listhandler to say if($node->tid || $node->og_groups) in the _mailhandler hook
4) However, listhandler gets to handle the mailhandler hook before og (alpha order on module_invoke), so there is a hack in my listhandler
5) I added a _comment hook in og. I added an og_mail_comment function also.
6) I added an og_queue_mail and an og_cron instead of sending mails on insert.
7) I allow for HTML emails from og using the activeMailLib.
Any awful assumptions so far? What do you think of the future of comments? Is their future as a node type, or is that discussion over?
Any ideas about a mailing lib being available as part of Drupal core?
Thanks,
samo
Comment #4
sethcohn commentedDefinately interested in patches... I'm working on making flexinodes also able to act 'forum' like in mailhandler/listhandlers eyes. Post a flexinode via mailhandler, send it to a list via listhandler, and then allow comments, same as forums do now...
Comment #5
moshe weitzman commentedthis might just work now. note that og_groups should be an array, so you should use the [] syntax.
Comment #6
adixon commentedYes, it works for 4.6 (see http://drupal.org/node/40777#comment-123925)
For 4.7, it doesn't work because node->og_group has changed, but see my patch here
http://drupal.org/node/74361
which fixes it.
Comment #7
ilo commentedIssues about non-default $node properties (those provided by additional modules) might need review to see if they work and probably better documentation, so I'm tagging them.
Comment #8
ilo commentedComment #9
socialnicheguru commentedright now I am using mail2og and mailhandler.
With Mailhandler 2-dev will I still have to use mail2og or og_mailinglist (which I don't believe are compatible with the 2-dev version).
Comment #10
danepowell commentedMailhandler 2.x does not support posting to OG yet, and I doubt that mail2og or og_mailinglist will work with it at all (though I don't know anything about them). I'm working on a more generalized command-handling system for 2.x than what's currently in place that might be able to take care of this: #1113888: Command arbitrary fields / CCK fields. If it can't handle posting to OG groups, you can always override the existing command plugin to handle posting to groups... the whole point of the 2.x branch is to be pluggable/extensible like that :)
Comment #11
danepowell commentedSounds like this is fixed for 1.x using mail2og. For 2.x, Mailhandler already supports this using the commands system. However, Feeds does not yet support it- see #857424: Mapper for Organic Groups . I haven't read through that issue, but I imagine once it is fixed, you should be able to command the organic group just like any other node property, by adding it as an 'available command' and mapping it to organic group.