CCK custom content type fields and scheduling using mailhandler

Mojah - May 3, 2007 - 22:28
Project:Mailhandler
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Can anyone share some info on how to submit custom cck type fields using mailhandler? Blogs, stories, pages and forum posts work fine. However with cck nodes, we have custom fields defined. How would one use mailhandler to post data specifically into those cck field types rather than into the node content?

Any ideas how to set the publish on date for the scheduler module? If someone could point me in the right direction of which part of the code to look into or ideas on a solution for posting cck nodes and setting their publish on date, it will be much appreciated.

#1

Oreps - July 29, 2007 - 00:38

yes i have the problem and how about integration with token

#2

rubenk - August 12, 2007 - 16:18

Yes, is there a way to post content to specific fields

#3

pvanderspek - September 30, 2007 - 12:18

I would be very interested in hearing how to do this as well.

#4

xpi - December 16, 2007 - 16:11

this would be very useful.

#5

troym559 - December 17, 2007 - 00:14

I am also very interested in doing this.

#6

me@andy-j-thorn... - January 22, 2008 - 19:40

i'd love to know how to do this too - just to join the chorus :-)

I am specifically trying to get this working with the calendar module, so that our events coordinator can send in events via email.

#7

kvantomme - May 6, 2008 - 22:26

I haven't found any ready made solutions but there should be a nice clue in the http://drupal.org/project/mailsave project. Imagefield handles the saving bit for images into CCK fields which is a far more complex trick than putting text into a field...

So if you are just looking for textfields I'm sure you can find out how to do this from this code.

#8

moshe weitzman - July 7, 2008 - 00:46

Email sucks for sending structured information like this. I don't see this getting solved anytime soon.

#9

zvizvi - July 18, 2008 - 02:13

still, how would you go around implementing a simple url field insertion for the userlink content type?
this is very crucial to us, since content fields are at the core of our site and, with or without relevance, taxonomy parsing keeps failing - even after removing the free tag vocabulary.

#10

zvizvi - July 27, 2008 - 12:39

besides, what do you mean by "Email sucks for sending structured information like this"?
it is are already (supposedly) supporting taxonomies, which are hierarchical, so what's the problem supporting an extra field for enabling sending of interesting content types such as userlink - something e-mail would be ideal for?

#11

matt_paz - August 1, 2008 - 13:59

I'm actually doing this in the 6.0 version ... I'm using the mail handler hook and parsing through parts of the message and then populating the cck values that I want. I agree that email isn't great for doing this, but sometimes it is very convenient. One of the other things that I'm doing that might be of some interest is that I'm using plain text as the node body, but then capturing the html formatted message in a seperate cck field ... that way, I've got something that is easy to read and don't have to worry much about bad html ... but also get the context of the original fully formatted message if I need to reference it.

#12

z.stolar - September 18, 2008 - 17:40

The difference between taxonomies and CCK fields, is that taxonomy terms are numbers, while a cck text field may contain line breaks, html code, symbols, and basically - anything.

I see Moshe's point in saying that email is not suitable for more-than-the-plain-text type of input, and although we do pass arrays, they are still one liners.

However, since CCK is indeed the de-facto way of constructing a node (and it's doing it's way into core), we should find a way to relate to it's fields. I don't know how.

@matt_paz: please share your processing of the fields - maybe we can learn something from it.

#13

matt_paz - September 19, 2008 - 14:54

Here's a simple example ...

<?php
function mailhandler_mod_mailhandler(&$node, $stream, $msg_number, &$header, $mailbox) {

           
$node->field_user_stakeholders[0]['value'] = $header->fromaddress;

}
?>

#14

z.stolar - September 20, 2008 - 19:15

@matt_paz: Thanks. Can you show an example mail also - I was more curious about the mail side of the processing.

#15

matt_paz - September 21, 2008 - 05:31

@z.stolar -> Not sure what you're looking for there ... can you elaborate? Thanks, Matt

#16

z.stolar - September 21, 2008 - 06:18

Yes,
Let's say you have a cck field of Address. It has the value of:

field_address: 134 76th st.
Apt. 4E
Forest Hills. Queens
New York 12345 NY

If you stick it in the mail's commands section, by default, the new lines will break your field.
I am interested to know how you instruct your users to structure their mails, in order for that field to be captured correctly (e.g., do you use special headers, or strings, to delimit the different fields?)

 
 

Drupal is a registered trademark of Dries Buytaert.