I have this working and it works well - - but I am not able to find a way format the html that is output in the delivered e-mail message - - there must be some trick here that I do not see - - the node I am delivering is highly styled with images - - do I have to embed a pdf?

Hints, guidance greatly appreciated

n

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

If you copy the template to print_mail.tpl.php, you'll be able to edit the template to make the delivered mail comply with your needs.

newtonpage’s picture

Thanks for the reply

I had looked for that file previously but it was not in the module directory.

I want to re-create the styling I created in the print_html file - - so I tried print_mail.tpl (which it did not see) and then tried print_mail.CONTENT-TYPE.tpl.php - - but neither worked - - not sure why it does not see this - - this file is co-located with the print template.

BTW - - I can see the default styling in the e-mail (with tables and


tags) - - but I cannot find the source

I will continue to paw through the module and the .inc but I do appreciate your guidance.

Also, your documentation is excellent - - as good or better than as any module I have seen - -but I could not find this reference there - - I would be happy to help update it once I see the solution

n

n

jcnventura’s picture

The documentation for the template file names is at http://drupal.org/node/306886

You have some errors with the filenames in your description above, so this may be why it didn't work for you.

João

newtonpage’s picture

Hi

Sorry for my negligence there. I will be more careful as you are very diligent in answering my questions.

So, for the "print-a-node tpl", for my custom content-type "activity", the file name should be:

print_html.node-activity.tpl.php

This is what I did and the styling works great - - and this is what I understood from the documentation.

But for formatting e-mail - - please excuse my ignorance here - - I am not sure what the documentation means.

The documentation says

print_[format].node-[type].tpl.php

But I understood the [format] to mean html versus pdf - - but now I think this may not be so

In any case, is the correct format for me:

print_mail.node-activity.tpl.php?

Thanks so much for your assistance

S

newtonpage’s picture

As an update - - per my other reply, I tried

print_mail.node-activity.tpl.php
(where activity is my custom content type)

I began by this file placing my theme directory, then tried my custom mail module directory, then in the print module, then in the sub-directory in the print module, print_mail - - none of these worked - - in every caseprovides to the default styling.

Note the following:

1) I duplicated the html and styling for the print case - - that is, the tpl files are identical - - so the css should also apply.

2) I found that the printing tpl required a full hmtl syntax (head, body and so on) since it did not appear to build from page.tpl
- - again, this works great (and again, kudos for executing a very tricky-to-do functionality)

3) I re-confirmed that the print module settings were calling the css file
- - in this respect, I wonder if the html in the mail wants a full path
- - I will try this since I am not getting images either

Have I made another careless error?

N

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for all the info.. I haven't tested this in a while, so I will test more and see if I can duplicate your problem.

newtonpage’s picture

I have tried a bunch of things with no luck

Will not see the theming - - can upload screen shot of the print output (which works great) and the mail output (which would like you would expect since it uses the table-based formatting from the default)

one possibility is to hack the default css with my own styling?
- - if so, which css file would this be?

Note that I do have a custom module for both print and mail and currently, the print-formatting css code is controlled from my master theme css
- - perhaps I could load a custom print mail css from that module?

Lastly, might it be better to export to mail as a pdf? I wonder if I can put links in - - I think I can but have not tried this yet

newtonpage’s picture

Hi

I appreciate so much how much time and effort you give to this module -- but I wonder if it is possible to resolve this issue. I am going into beta soon and need to retire this pending issue.

Any guidance or suggestions would greatly appreciated

thx

N

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Hi,

I have just tested this and it seems to be working well. I have modified my print.tpl.php file and copied it to print_mail.node-page.tpl.php. I modified the page only template and those changes are visible only on emails sent from that content type.

I tested the file both in the print module directory and in the theme directory.

If there's a problem, it must be something that is activating only in your setup.. You've mentioned that you modified the module, so maybe the problem is linked to that.

João

newtonpage’s picture

Hi

thanks for the reply.

No , I did not modify the module. I have written a module to handle various aspects of customization - - but it may be noteworthy that the print aspect works well.

I will re-try this and will re-create my print_mail.node-page.tpl.php file and let you know.

N

newtonpage’s picture

Hi

thanks for the reply.

I have done what you suggested and I cannot determine if the print module is seeing the print_mail.tpl.php file. The output in the delivered e-mail remains the same - - styled as a table. A complication here is that the styling is quite complex with many images (coded as backgrounds from a sprite).

One thought, I wonder if it might be easier to output a pdf and let this be placed into the body of the e-mail.

Is this possible?

If so, it would avoid all the issues related to accessing a style sheet and the images and so on from an unknown e-mail program.

If someone has done this, I would really appreciate tips and guidance.

Thoughts?

Thanks so much

N

jcnventura’s picture

I find it really strange that in your setup the module is unable to access the print_mail.tpl.php file.. Maybe there's already a template file for that type installed in your theme directory.

As to embedding a PDF in the e-mail, the module can't do it yet, but it is of course possible if someone bothers to do it. I have very little time available at the moment, so I can't do that myself.

João

newtonpage’s picture

Hi

I appreciate the time you are taking to help me out here.

Perhaps I am confused but I think I have followed the documentation, though I have clearly made a few mistakes.

1) The print module I installed did not have a print_mail.tpl.php file. I created one and placed in the theme directory.

2) I created a print_html.node-activity.tpl.php and placed this in the theme directory. This works great.

3) The theming is identical in both .tpl's.

4) I am not certain that the print does not see the print_mail.tpl.php file since I can only see the e-mail output as received at the address I sent it to - - and the formatting is the same with or without the print_mail.tpl.php file (formatted using tables where I do not use tables in this formatting).

5) My assumption, then was that the module is not seeing the print_mail.tpl.php file and is taking the node output and formatting it in a table style (which is what I see in the default print.css file).

So, I am not sure what to here as it is required I provide emailing capability. For the moment, I would be content to not do images but to able to format the sections with an e-mailed.

Again, thanks for taking the time to respond to these questions.

N

jcnventura’s picture

Hi,

Following your points:

1. Yes, the module provides only the one-for-all print.tpl.php file which is the generic template used to generate the html, mail and pdf versions. To have a print_mail specific file, you need to create one.

2. At least something is working :)

3. Good to know, for your reference, if it is identical in both template files, you might wish to not have two files and simply have a print.node-activity.tpl.php file.

4. This is what confuses me.. Can you please insert some content (i.e. text) into the templates so that you can make sure that it uses the html template for the html version and the mail template for the mail version. (Just write 'this is the email/html version" inside the h1 for the title)

5. The module doesn't render anything into a table that isn't in the content as a table.. Even if your theme is using tables, the module will try to remove them. I don't understand your reference to the print.css file..

As to the images, if you use the mime_mail module, it will embed the images in the mail, so any decent e-mail reader should display the mail properly.

João

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No further info in two weeks. Closing the issue.