Which template is used for mailing list mail?

18 views
Skip to first unread message

Jason Judge

unread,
Jan 14, 2010, 8:43:04 PM1/14/10
to MailPress
The newsletters (digest e-mails against categories) and the comment
emails (against comments on specific posts) all use templates from the
current MP theme.

The mailing list messages use the same header.php and footer.php as
the other emails, but I cannot see what template they use. Do they use
a template, or is the body format hard-coded somewhere?

I would like the mailing list emails to use a different format header
and footer. Is there any way this can be detected in the header.php
template? i.e. does the template header know when it is being used for
a mailing list e-mail rather than a newsletter or comment
notification?

Or would I need to create a new theme for use only with the mailing
list e-mails, with its own header.php and footer.php?

-- Jason

andré renaut

unread,
Jan 15, 2010, 3:38:55 AM1/15/10
to mail...@googlegroups.com
newsletters are using the following templates :

single, singlecat, daily, dailycat, weekly, weeklycat, monthly, monthlycat

comments is using the following template :

comments

if you have checked the option " ", standard wp mails can also be customized in following templates

mailpress/mp-includes/wp_pluggable.php:156:    $mail->Template    = 'moderate';
mailpress/mp-includes/wp_pluggable.php:241:    $mail->Template    = 'moderate';
mailpress/mp-includes/wp_pluggable.php:276:    $mail->Template    = 'changed_pwd';
mailpress/mp-includes/wp_pluggable.php:308:    $mail->Template    = 'new_user';
mailpress/mp-includes/wp_pluggable.php:329:    $mail->Template    = 'new_user';
mailpress/mp-includes/wp_pluggable.php:360:    $mail->Template    = 'retrieve_pwd';
mailpress/mp-includes/wp_pluggable.php:394:    $mail->Template    = 'reset_pwd';

otherwise at any moment if a template is not found in the required theme (this is what currently happens for any manual mail) :
* MailPress looks for a specific file named 'default.php' (this file is not a template).
* if this file is not found MailPress will intent to build the mail using the following code (hard-coded):
<?php $this->get_header(); $this->the_content(); $this->get_footer(); ?>


That is what you have to know about templates and how they are used in MailPress.

By writing all this, i think that you can have a dedicated template by designating a specific template for manual mails (i never thought of this before and will be integrated in future release)

in mailpress/mp-includes/class/MP_Mails.class.php
find this function : send_draft
under the following line : if (!empty($draft->theme)) $mail->Theme = $draft->theme;
add the following line : $mail->Template = 'manual';

then in your mailpress theme folder, add file manual.php. To make it a template, first lines of the file must be
<?php
/*
Template Name: manual
*/
?>




2010/1/15 Jason Judge <jason....@gmail.com>
--
=== Please Donate ! https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=andre%2erenaut%40gmail%2ecom&lc=US&item_name=MailPress&item_number=gg&amount=5%2e00&currency_code=EUR&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest ===

You received this message because you are subscribed to the Google
Groups "MailPress" group.
To post to this group, send email to mail...@googlegroups.com
To unsubscribe from this group, send email to
mailpress+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mailpress?hl=en




--
Pensez à l'environnement avant d'imprimer ce message.
Please, think about the environment before printing this message.

Jason Judge

unread,
Jan 15, 2010, 5:34:54 AM1/15/10
to MailPress
Somehow the current date was getting inserted between the header and
the body of the manual e-mail, which made me think that perhaps there
was a template involved, but I couldn't find one structured as
header>date>body>footer

I'll apply this suggested template patch to my local version and give
it a go.

Thanks,

-- Jason

> 2010/1/15 Jason Judge <jason.dju...@gmail.com>


>
>
>
> > The newsletters (digest e-mails against categories) and the comment
> > emails (against comments on specific posts) all use templates from the
> > current MP theme.
>
> > The mailing list messages use the same header.php and footer.php as
> > the other emails, but I cannot see what template they use. Do they use
> > a template, or is the body format hard-coded somewhere?
>
> > I would like the mailing list emails to use a different format header
> > and footer. Is there any way this can be detected in the header.php
> > template? i.e. does the template header know when it is being used for
> > a mailing list e-mail rather than a newsletter or comment
> > notification?
>
> > Or would I need to create a new theme for use only with the mailing
> > list e-mails, with its own header.php and footer.php?
>
> > -- Jason
>
> > --
> > === Please Donate !

> >https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=andre%2...


>
> > You received this message because you are subscribed to the Google
> > Groups "MailPress" group.
> > To post to this group, send email to mail...@googlegroups.com
> > To unsubscribe from this group, send email to

> > mailpress+...@googlegroups.com<mailpress%2Bunsu...@googlegroups.com>

Jason Judge

unread,
Jan 15, 2010, 6:09:26 AM1/15/10
to MailPress

On Jan 15, 10:34 am, Jason Judge <jason.dju...@gmail.com> wrote:
> Somehow the current date was getting inserted between the header and
> the body of the manual e-mail, which made me think that perhaps there
> was a template involved, but I couldn't find one structured as
> header>date>body>footer

Just looked again - the date was being displayed in default.php I
overlooked that one previously because - as you say - it is not a
template.

-- Jason

Reply all
Reply to author
Forward
0 new messages