I've read this in a reply to a mail:
Danke der Nachfrage!
Why is der there and why is not für die Nachfrage instead? And is it genitive or dative? (My only guess is that we are omitting a preposition, but I've never seen that in German).
Wie schon anderswo erklärt, kann „danken“ ein Dativ- und ein Akkusativobjekt haben, um auszudrücken, wem und wofür gedankt wird. Dort wo wir heute den Akkusativ benutzen, wurde laut Grimm (Punkt 3) im Mittelhochdeutschen und noch darüber hinaus bis ins 16. Jahrhundert der Genitiv verwandt. Dies scheint sich in der Wendung „Danke der Nachfrage“ erhalten zu haben.
It is genitive, a verbal phrase and a ellipsis. The full sentence (with subject) is
And here is the Word "danke" asking for the genitive. This is oldstyle grammar, and "Danke der Nachfrage" ist the only case where genitive comes after "danke".
As already pointed out by others, it is a Genitivobjekt. Even native speakers have a hard time with it, because genitive objects are very rare, and mostly used in the gehobene Sprache.
A native speaker would check by replacing the feminine word with a masculine one:
which is correct (although it's perceived as wrong by many native speakers nowadays, see below)
You could also say:
which of course cannot have two dative objects, thus confirming that der Nachfrage is genitive.
Other languages have the same construct. E.g., thank you for the flowers is merci des fleurs in French and grazie dei fiori in Italian.
It looks like I perceive the above German sentences as correct more than the average German speaker. This may be due to the fact that I'm also a native Italian speaker.
It also looks like the genitive object with danken ceased to be common a few centuries ago, and barely survived, hiding in phrases like the one that rightly puzzled you (see the answer by Carsten Schultz). Here is an example of its usage in the old times (end of the 15th century).
The most complete equivalent sentence would be:
which sheds some light, I think, on the origin of the genitive.
It looks like many Germans really perceive Danke der Nachfrage as meaning Thanks to the enquiry, as if, in this case, it were correct to replace a human recipient with the inanimate enquiry. Of course, for these people my first two examples are incorrect. Upvotes and downvotes in this forum are not a good measure for average German, unfortunately, and I wouldn't know how to quantify the different grammatical feelings about this phrase.
EDIT 4 (and hopefully last)
It would be unfair and confusing to rewrite my answer, but...
My test sentence for native German speakers should have been:
Judging by votes and commentaries, people here (who on average are more competent than the average German speaker), consider it more correct than
which might or might not be considered the correct form by the majority of speakers if they had to choose, but we have no way of finding out. (Anyone here can arrange their little poll, though!)
And to answer your first question: Danke für die Nachfrage would certainly be preferred today, but business letter language evolves definitely more slowly than spoken language, to the point that, as in this case, people sometimes write things they don't really know the meaning of...
I perceive it to be Dative. Also, I think the "danke" is not thought of as a verb but as the plain thanks (which of course comes from the verb but it doesn't feel like a verb anymore)
The "Nachfrage" is what the "thanks" is directed to... of course it is directed to the listener but "Nachfrage" is the cause, the trigger. I would say a proper long version (based on grammatical feel) is:
DWDS gibt bei Eingabe von danken im ersten Kasten links an
Man beachte die Kleinschreibung von "danke". Das dürfte ein Indiz dafür sein, dass es sich um ein elliptisches "ich danke" handelt und nicht um das Substantiv Dank.
Im ersten Kasten rechts (Etymologisches Wörterbuch von Pfeifer) findet sich die Information: jemandem danken für etwas (die Angabe wofür ursprünglich im Genitiv).
It's a dative not a genitive. This is often the case for arguments that can broadly be described as indirect objects or beneficiaries. (Genitive objects are used to indicate partitive constructions in archaic usage: "Er trank des Wassers" -- "He drank of the water")
As mentioned in another answer, you could make a full sentence:
which you could conceptualize as "ich gebe der Nachfrage meinen Dank".
As final proof that it's dative:
NOT (I use the asterisk like a linguist to indicate ill-formed):
Ich danke Dir für die Nachfrage.
Danke der Nachfrage – von Dir / Ihnen. Sie hat mich auf eine neue Idee gebracht.