Just like the title says. Right now this is not possible. The user has to know the tag(s) beforehand.

Would this be possible/easy to add?

Comments

eliosh’s picture

I Agree.
It'll be very nice to configure a basic vocabulary, and than add terms to it

moshe weitzman’s picture

You could write a module which parsed information out of the subject or body and created/affiliated tags accordingly. after that, we'll see how clean and how popular it is and consider adding to mailhandler itself.

moshe weitzman’s picture

this would be possible if we enhance the Commands syntax as per my suggestion at http://drupal.org/node/136606

z.stolar’s picture

I'm looking into this issue, trying to see if I can create the necessary patch for free tagging support in mailhandler.
Does anyone know of any progress in this direction in the last few months?

z.stolar’s picture

Version: 5.x-1.x-dev » 5.x-1.3
Assigned: Unassigned » z.stolar
Status: Active » Needs review
StatusFileSize
new3.15 KB

The attached patch allows mailhandler to receive tags from free tagging vocabularies.
In order to do that, use the following commands:

* The usual, add regular, EXISTING terms, from whatever vocabulary:
taxonomy: [term1, term2]

* In order to add tags from free tagging vocabularies, use an array-like format, where the key is the VID of the free tagging vocabulary:
taxonomy[4]: [existing term1, existing term2, totally new term3]

The later should work for non free tagging vocabularies as well

moshe weitzman’s picture

Status: Needs review » Needs work

Thanks. Could you add some documentation to the Commands section of the help? Also, I really prefer to commit to D6 at the same time. Please consider making patch for it. Some functions have moved around.

Thanks.

z.stolar’s picture

I will add the documentation, and have a look at the D6 version, but I wanted first to get some feedback on the path I chose.
Mainly, I'd like to know if the format looks reasonable (...usable). Currently a user needs to know the vocabulary id, in order to add terms to it. Does anyone have suggestions for a better format?

For ease of use, I thought maybe have only up to two taxonomy commands:
taxonomy[terms]: which will be equal to the current taxonomy: command
and
taxonomy[tags] (or [new tags] or [freetags]...) which will add any new terms to the first free tagging vocabulary for that node type.

While this limits the possibilities, it may ease the use of the module for those who don't know the vocabulary id (which is probably true in most cases)

moshe weitzman’s picture

At first read, I like your proposal in the patch the best.

gaele’s picture

z.stolar, thanks for this patch.

Although vocabulary id may not be the easiest way for users, it is the cleanest way. I like that.

z.stolar’s picture

Status: Needs work » Needs review
StatusFileSize
new8.64 KB

@Moshe: there was no Commands section on the help page, so I added one :-)

This patch includes the same addition of free-tagging in mailhandler, and adds a section to the help page of mailhandler.
Currently listed are only the taxonomy commands, but there's a nice associative array, that facilitates the addition of more commands, and their description.
It is done like this (in hook_help):

$commands[] = array('command' => 'taxonomy: [term1, term2]',
                      'description' => t('Use this to add the terms <em>term1</em> and <em>term2</em> to the node.<br /> Both of the terms should already exist. In case they do not exist already, they will be quietly ommitted'));

z.stolar’s picture

StatusFileSize
new8 KB

And here's a corresponding patch for Drupal 6 (I'd put HEAD in the version tag, but I read somewhere the project hasn't got a HEAD branch).

z.stolar’s picture

Version: 5.x-1.3 » master
StatusFileSize
new7.98 KB
new8.65 KB

I fixed both my earlier patches, due to some errors I just found.
Attached are two patches - one for D5, and one for D6.

moshe weitzman’s picture

Status: Needs review » Needs work

I am getting failed hunks with these patches ... Looks like some of the Command docs which used to be in the module now live at http://drupal.org/handbook/modules/mailhandler/. I have no strong feeling about where they should be.

z.stolar’s picture

Status: Needs work » Needs review
StatusFileSize
new5.28 KB
new8.02 KB

I rerolled the patches, and tested them - they seem to apply cleanly now (I took out some lines).
Please test.
Attached are two patches, for D5 and D6

moshe weitzman’s picture

Status: Needs review » Fixed

Committed with just a code review. Would be great if folks could test this.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.