Drupal 6 : Programmatically creating nodes for OG..!
I am creating nodes pro-grammatically for a portal by fetching emails. But I have got a situation here.
I have some Organic group and every OG has got it's own content type. At start I thought to use different mailbox for each OG.
Now the thing is..how to assign nodes which get create pro-grammatically to particular OG ?
Note :- I am able to create different kind of nodes based on subject of the mail.
When you are creating the node object set its og_groups property to an array of all the nids of the groups you want it in. For example if you have a group with nid 4, and you want your node to be in that group do this before calling node_save on it.
$node->og_groups = array(4);
After saving that node it should be in the og with nid 4.