Closed (fixed)
Project:
Simplenews
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2007 at 16:32 UTC
Updated:
21 Dec 2009 at 09:53 UTC
I really like this module!
Is there a way to get rid of the annoying title text from the body of the email when it's sent?
As a side question, is there any way that a user can customize the subject line without the "[Newsletter Name] Title" format? Thanks!
Comments
Comment #1
sutharsan commentedYes, subject, title, message body and more can be customized by theming.
Override the Simplenews theme functions as described in the handbook: http://drupal.org/node/55126
You need to override the theme_simplenews_newsletter() function.
Comment #2
Ray Seaman commentedThanks for your quick reply, Sutharsan.
I'm no coder, so is there a code snippet that you could point me to that all I'll need to do is copy and paste?
I would like the title to be my subject, but not have the title text appear in the body of my email - that's all.
Thanks again!
Comment #3
Ray Seaman commentedComment #4
sutharsan commentedIt is actually quite simple once you know the trick:
(assuming you have a theme based on phpTemplate engine)
1. Find the function I mentioned in #1
2. Copy this modified function into the template.php file
3. Change the "theme_" part of the function name into "phptemplate_"
4. Start messing with the content of the function until you have the result you want.
At step 3 you have this code:
Learn this trick, read the manual, get practice and you will be a theming master ;)
Comment #5
roald commentedHi!
I had the same wish (also since the strtoupper function used does not handle accented characters very well), so I edited line 2304 in simplenews.module from
$node->body = '<h2>'. $node->title ."</h2>\n". $node->body;to
$node->body = $node->body;Easy and dirty, but worked ;-)
Roald
Comment #6
Ray Seaman commentedThanks!
It works, but there's still a large gap between the top of the email and the beginning of the message, which is rather unsightly from a design perspective.
I'll of course be looking into Sutharsan's method as well when I get some time.
Thanks again!
Comment #7
sutharsan commentedYou may have a look at simplenews_template module. This give more control over the newsletter theming.
Feel free to re-open the issue if you need more support.
Comment #8
Ray Seaman commentedThanks! I actually did get SimpleNews to do what I wanted to do by using the theme override stuff you mentioned earlier. Thanks again!
Comment #9
gmclelland commentedWhen I try to add the code snippet(Sutharsan's) above to my template.php, it results with this error.
Any ideas on how to fix this?
Thanks
Comment #10
gmclelland commentedI think this is causing an error because simplenews_template.module is overriding the simplenews.module theme function. Now how would I override simplenews_template.module function in my template.php?
I don't want hack the simplenews_template.module.
Thanks
Comment #11
gmclelland commentedOk, it looks like I just had to override these functions.
function phptemplate_simplenews_template_content()
function phptemplate_simplenews_template_mail_subject()
Comment #12
drupal@guusvandewal.nl commentedI've succesfully removed the title of the newsletter by editing the template.php like this (Drupal6) :
For changing the email subject edit template.php:
Hope this helps others, thanks for pointing me in the right direction.
G