Home Forums Newsletter Plugin Support "Create the email" generates nothing

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #8614
    gilesfreeman
    Participant

    Ciao Stefano,

    Thankyou for creating and maintaining this plugin.
    I had it working brilliantly on my own server.

    I’m creating a newsletter for an non profit NGO here in Vietnam (so contact with their tech support is really hard). I created the newsletter on my own apache server – latest wp / newsletter plugin. Moved everything to Vietnamese server (windows) latest wp / newsletter plugin. Newsletter appears fine in “New Newsletter” but when I go to “Create Email” I get an empty message field as per attachment. Any ideas?

    http://gilesfreeman.com/download/newsletter.png

    #8615
    gilesfreeman
    Participant

    this is the email, generated and ready to go:
    http://gilesfreeman.com/download/create-newsletter.png

    #8616
    Stefano
    Keymaster

    Hi, are you using a custom theme? And about the graphical version, does it show correctly?

    Stefano.

    #8617
    gilesfreeman
    Participant

    Hi Stefano!

    Yes, I’m using a custom theme. It displays fine in the “New Newsletter” page
    (ie location is http://sef.org.vn/newsletter/wp-admin/admin.php?page=newsletter_emails_new)
    The next step seems to be the problem – it doesnt seem to create the html email.

    #8621
    Stefano
    Keymaster

    But, using a standard theme does it work? Or still there is generation problems?

    Stefano.

    #8623
    gilesfreeman
    Participant

    Hi again,

    No luck I’m afraid, I tried with three standard themes still no generation.
    I feel the problem may lie with the windows server, I’m just not sure where to look.

    Thankyou,

    Giles

    #8624
    gilesfreeman
    Participant

    Oops, Scratch that, I got it to work using theme-3. Must be a fault in my theme code. I’ll start debugging…

    
    <?php
    global $newsletter; // Newsletter object
    global $post; // Current post managed by WordPress
    
    /*
     * Some variabled are prepared by Newsletter Plus and are available inside the theme,
     * for example the theme options used to build the email body as configured by blog 
     * owner.
     * 
     * $theme_options - is an associative array with theme options: every option starts
     * with "theme_" as required. See the theme-options.php file for details.
     * Inside that array there are the autmated email options as well, if needed.
     * A special value can be present in theme_options and is the "last_run" which indicates
     * when th automated email has been composed last time. Is should be used to find if
     * there are now posts or not.
     * 
     * $is_test - if true it means we are composing an email for test purpose.
     */
    
    // This array will be passed to WordPress to extract the posts
    $filters = array();
    
    // Maximum number of post to retrieve
    $filters['showposts'] = (int)$theme_options['theme_max_posts'];
    if ($filters['showposts'] == 0) $filters['showposts'] = 100;
    
    // Include only posts from specified categories. Do not filter per category is no
    // one category has been selected.
    if (is_array($theme_options['theme_categories'])) {
        $filters['cat'] = implode(',', $theme_options['theme_categories']);
    }
    
    // Retrieve the posts asking them to WordPress
    $posts = get_posts($filters);
    
    // Styles
    $color = $theme_options['theme_color'];
    if (empty($color)) $color = '#777';
    
    $font = $theme_options['theme_font'];
    $font_size = $theme_options['theme_font_size'];
    
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
        <title></title>
        <style>
            * {
                font-family: <?php echo $font; ?>;
                font-size: <?php echo $font_size; ?>;
            }
    		h1 {
    		font-family:Georgia,serif !important;color:#242424;padding-bottom:15px;size:24px;line-height:26px;padding:0;margin:0;font-weight:normal;text-align:left;text-decoration:none;
    		}
    		img {width:150px;height:150px;}
        </style>
    </head>
    <body>
      
    <table style="background:#ffffff" width="600" align="center" border="0" cellpadding="0" cellspacing="0">
    
        <tbody>
    	<tr>
    	<td style="color:#363636;font:normal 11px georgia,serif;text-align:center;padding:10px 0 20px 0">
    	<?php echo $theme_options['theme_pre_message']; ?>
    	</td>
    	</tr>
    
        
    
        <tr>
        <td>
    
    	<table width="100%" align="center" border="0" cellpadding="20" cellspacing="0">
    	<tbody>
    	<tr>
    	<td style="background:#ffffff">
    	<p style="text-align:center;margin:0;padding-top:5px;padding-bottom:5px">
    	<img src="<?php echo $theme_url; ?>/images/logo.100.gif" alt="" style="width:100px !important;  height:100px !important;">
    	</p>
    	
    	<p style="color:#121212;font-family:georgia,serif;font-size:36px;text-align:center;margin:0;padding-top:5px;padding-bottom:5px;border-top:1px dotted #e1e2e3">
    	<?php bloginfo('name'); ?>
    	</p>
    	
    	<p style="color:#363636;font-family:georgia,serif;font-size:18px;text-align:center;margin:0;padding-top:5px;padding-bottom:5px;border-top:1px dotted #ebebeb">
    	<?php bloginfo('description'); ?>
    	</p>
    	
    	<p style="color:#363636;font-family:georgia,serif;font-size:12px;text-align:center;margin:0;padding-top:3px">
    	Hanoi, Vietnam
    	</p>
    
    <table cellpadding="10" style="table-layout:fixed; width:865px; color:#121212; font:normal 12px/1.5em georgia,serif; margin:0 0 0 0; padding:0 0 0 0; border-bottom:1px dotted #e1e2e3";>
    <tbody>
    
    <?php 
    $cat_args = array(
      'orderby' => 'name',
      'order' => 'ASC',
      'child_of' => 0
    );
    
    $categories =   get_categories($cat_args); 
    
    foreach($categories as $category) { 
    echo '<tr style="background:#fff;"><td><img src="'.$theme_url.'/images/white.png" alt="" style="height:50px !important; width:150px !important;"></td></tr>';
    echo '<tr>';
    echo '<td style="background:#bbe3b9; width:160px !important;">';
    echo '<h1 style="font-family:Georgia,serif !important;color:#242424;font-size:24px;line-height:26px;padding:0;margin:0;font-weight:normal;text-align:left;text-decoration:none;">' . $category->name.'</h1>';
    echo '</td">';
    echo '<td style="width:150px !important;"></td>';
    echo '<td style="width:150px !important;"></td>';
    echo '<td style="width:150px !important;"></td>';
    echo '<td style="width:150px !important;"></td>';
    echo '</tr>';
    
    	
         $post_args = array(
          'numberposts' => 5,
          'category' => $category->term_id 
        );
    echo '<tr>';
        $posts = get_posts($post_args);
    	
    	foreach ($posts as $post) {
    		setup_postdata($post);
    		$image = nt_post_image(get_the_ID());
    	?>
    	
    	<td style="vertical-align:left; margin-right:10px; margin-bottom:0; padding-right:10px!important; border-right:1px dotted #e1e2e3; background:#d6eed5;">
    	
    	<div style="height:190px !important; border-bottom: 1px solid #fff;">
    	
    	<div style="margin:0;">
    	<a target="_tab" href="<?php echo get_permalink(); ?>" target="_blank">
    	<img src="<?php echo $image; ?>" alt=""  border="0" style="vertical-align:top; padding:0px; margin:0px; display:block; width:150px; height:150px;">
    	</a>
    	</div>
    	
    	
    	<div style="display:inline-block;text-align:left;font-family:arial,sans-serif;font-size:11px;background:#bbe3b9;margin:0;padding:5px;">
    	<a target="_tab" href="<?php echo get_permalink(); ?>" style="color:#121212;font-weight:bold;text-decoration:none" target="_blank">
    	<?php echo $theme_options['theme_read_more']; ?>
    	</a>
    	</div>
    	
    	</div>
    	
    	<p style="font-family:georgia,serif;color:#242424;font-size:18px;line-height:18px;padding:0">
    	<a target="_tab" href="<?php echo get_permalink(); ?>" style="color:#242424;text-decoration:none" target="_blank">
    	<?php if (strlen($post->post_title) > 50) {
    	echo substr(the_title($before = '', $after = '', FALSE), 0, 40) . '...'; } else {
    	the_title();
    	} ?>
    	</a>
    	</p>
    	<p style="font-family:'Arial',sans-serif !important;line-height:1.5em;margin:15px 0; padding-right:10px;"><?php the_excerpt(); ?>. </p>
    	</td>
    	
    	<?php 
    	} 
    	echo '</tr>';
    } 
    ?>
    
    </tr>
    <br/>
    
    	</tbody>
    	</table>  
    	</tbody>
    	</table>  
      
    </body>
    </html>
    
    
    #8625
    Stefano
    Keymaster

    Hi,

    if you want to send me an administrative account at stefano@satollo.net I can add some debug code inside a theme to try to find the problem.

    In the meanwhile can you check if the output buffering of PHP is enabled? You can ask that to your provider.

    Stefano.

    #8626
    gilesfreeman
    Participant

    Thankyou very much Stefano. It’s the “CE” theme. Login details sent through. I’d be very greatful. I’ll check tomorrow morning with the providor re output buffering.

    #8636
    gilesfreeman
    Participant

    Hi Stefano,
    Did you have any luck with the debugging code?
    For the moment I’m just copy pasting to create the email.
    Thanks,
    Giles

    #8637
    Stefano
    Keymaster

    Hi I have not received the credentials to access the blog. Did you send them to me?

    Stefano.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.