It seems like currently it doesn't support cck body. In other words !body is empty if content type has other then standart drupal's body. I'm not sure is this should be addressed to mail_edit module or here.

Comments

gustav’s picture

I have seen somewhere (I can't remember where) the very good suggestion that for this purpose the subscription module should hook into CCK to provide an extra column on admin/content/types/xxxx/display. On that page one currently can configure how a CCK field should display in the teaser and how it should display on the full node page. It is thus the natural place to specify how it should display in a notification email.

nbayaman’s picture

I don't know if it's better or not then your idea, but i think using tokens module would solve this issue. This seems to me like more flexible way of customizing of the mail body.

gustav’s picture

I think that as a first step a new variable !full should be added to the list of variables that can be used in the mail templates. This should provide the full node content as defined by the content type.

nbayaman’s picture

sure, that would make a room to breath for now :)

salvis’s picture

And who (or what) would set !full?

The architecture of mail_edit and Subscriptions is such, that any module should be able to define additional content types and/or variables.

gustav’s picture

What is contained in the full content of a node is specified by the admin at admin/content/types/xxxx/display (for content type xxxx).

nbayaman’s picture

is there already !full variable?

salvis’s picture

Status: Active » Postponed (maintainer needs more info)

!full as in $node->full or what?

gustav’s picture

Version: 5.x-2.0-beta4 » 5.x-2.0-beta11
Status: Postponed (maintainer needs more info) » Active

I think !full should contain the return value of node_view() (see http://api.drupal.org/api/function/node_view/5)

salvis’s picture

Interesting — we'll try that, thanks!

salvis’s picture

Version: 5.x-2.0-beta11 » 5.x-2.0-beta12

I've tentatively implemented !full using node_view() in BETA12. Please let me know how that works out.

salvis’s picture

!full_node is essentially a dump of the node. It's useful in its own right — I'll keep it, but I'll disable it by default, so it doesn't unnecessarily waste cron time.

For CCK, the results aren't so great, because the CCK fields are only in <div> tags, and without any CSS styling, they run together, because node_view() returns something like

<div class="node">
  <span class="submitted">
    Submitted by 
    <a href="/user/3" title="View user profile.">Test3</a> 
    on Mon, 2008-03-24 12:24.
  </span>
  <span class="taxonomy"></span>
  <div class="content">
   <div class="field field-type-userreference field-field-user-field">
      <div class="field-label">User_field:&nbsp;</div>
      <div class="field-items">
         <div class="field-item">
          <a href="/user/4" title="View user profile.">Test4</a>
        </div>
      </div>
    </div>
    <p>BODY TEXT</p>
  </div>
</div>

HTML to text simply removes the <div> tags, and so the fields all end up on the same line with the "Submitted by" information, producing something like

Submitted by Test3 [1] on Mon, 2008-03-24 12:17. User_field: Test4 [2]
BODY TEXT


[1] http://example.com/user/3
[2] http://example.com/user/4

This is obviously not good enough...

salvis’s picture

Assigned: Unassigned » salvis
Status: Active » Needs review
StatusFileSize
new2.08 KB
new167 bytes

Please try this. It creates variables

cckLabel_<fieldname>
cckValue1_<fieldname>
cckValue2_<fieldname>

as explained on the mail_edit pages (the variable listing will be fixed). Let me know how it works.

(remove ".txt" and "_.txt" from the file names)

P.S. I posted a similar add-on module for Events 5.x-2.x-dev at #236123: Weekly email of all upcoming events.

salvis’s picture

Version: 5.x-2.0-beta12 » 5.x-2.0-rc1
Status: Needs review » Fixed

It would have been nice to get some comments here, but since no one complained, I'm marking this done. Please reopen if there's a problem.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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