WordPress.org

Forums

Subscribe2
Odd random spaces in digest (9 posts)

  1. Matt Northam
    Member
    Posted 3 years ago #

    Hi!
    So, I've got the HTML version of the plugin and have made some changes to the digest email template (namely, adding a table to include a header image and some footer info etc).. When using v6.3 of the plugin, I had no issues with this and all worked well. However, I've tried to emulate the changes with v7.2 and have noticed that I now get random spaces appear throughout the digest email.

    For instance, a post title could read like:
    "This is my great p ost!".

    Or the excerpts might have the same thing. It's really noticeable when bringing in post images, because I sometimes get a bit of whitespace in the image file name (which obviously breaks the path).

    Also, possibly related, sometimes the <td> tags don't work so I get merged table cells.. I think it's because the random space issue is occurring inside the <td> tag.

    I wish I could give more specifics about when this happens, but it's not consistent enough to debug properly! Just wondered if anyone else had found this issue and/or managed to resolve it?!

    http://wordpress.org/extend/plugins/subscribe2/

  2. Matt Northam
    Member
    Posted 3 years ago #

    After another 5 hours or so on this, I've narrowed it down to potentially this problem:

    http://www.jeremytunnell.com/posts/really-hairy-problem-with-seemingly-random-crlf-and-spaces-inserted-in-emails

    which implies something happening with the character limit when sending an email with certain encoding.

    The bog-standard html output, before I send the email, is fine.. It's only when the email is sent that it starts to generate those white spaces..

    I just have no idea how to fix it :/

  3. mattyrob
    Member
    Posted 3 years ago #

    @Matt,

    Very strange and I'll have to admit that I cannot really give you many pointers.

    Have a look at an email you've received and look at the Content-Encoding. Is it '8 bit'.

    In the article you linked to it seems that switching to base64 encoding helped. I think you'd need to change this using the 'phpmailer_init' action and setting the Encoding to something other than 8bit - maybe base64 for example.

  4. Matt Northam
    Member
    Posted 3 years ago #

    Thanks for the reply.. I tried changing the encoding but with no luck, so ended up re-writing your mail function to explicitly make use of the PHPMailer class, based on the 'dj_emailpublish_wp_mail' function here: http://plugins.svn.wordpress.org/dj-email-publish/tags/1.6.1/dj-email-publish.php

    That seems to work fine with the previews, though I'm waiting to see what happens with the cron generated email! Fingers crossed! Am I right in thinking that the relevant line (that previously called your mail function) is inside the subscribe2_cron function of the plugin(?) i.e.

    if ( $preview != '' ) {
    	$this->myemail = $preview;
    	$this->myname = __('Digest Preview', 'subscribe2');
    	$this->mail(array($preview), $subject, $mailtext, 'html');
    } else {
    	$public = $this->get_public();
    	$all_post_cats_string = implode(',', $all_post_cats);
    	$registered = $this->get_registered("cats=$all_post_cats_string");
    	$recipients = array_merge((array)$public, (array)$registered);
    	$this->mail($recipients, $subject, $mailtext, 'html');
    }

    Because that (the last line of each section) is what I've removed and changed to my new mail function..

  5. mattyrob
    Member
    Posted 3 years ago #

    @Matt,

    Yes, the $this->mail() calls my mail function which is a wrapper for the WordPress wp_mail() function which in turn calls PHPMailer. So, you've cut out a few steps right there in your bug hunt.

  6. Matt Northam
    Member
    Posted 3 years ago #

    Cool. Well, it all seemed to go fine.. The digest sent out today as planned. It DID have more than just the last day's posts in, but I'm guessing that it actually included all the posts that had been made since the last successful digest email(?)

    Final question if I may :) today, I got various out of office replies back to me, whereas previously that never happened. I can add a different reply-to address in there, but just wondered if you had built in anything that used to handle those bounce backs?

    Thanks!

  7. mattyrob
    Member
    Posted 3 years ago #

    @Matt,

    If you are accessing PHPMailer directly you can easily add it like this:
    $mailer->AddReplyTo('reply-to@yourdomain.com', 'Reply To Address');

    Subscribe2 does not handle bounce backs as it does not access your email account inbox.

  8. Matt Northam
    Member
    Posted 3 years ago #

    Hi again,

    Been a while but just wanted to pop back to say that I couldn't get the reply-to to work for whatever reason, but no worries.. There's not too many of them.

    One thing though, thought I'd post it here on the off chance you read this, but my yearly subscription to the html version of is up for renewal, but the paypal account it's linked to is defunct (the person who paid for it no longer works here) - is it possible to change the contact details for a subscription, or should i buy 'new' to set up a new payment plan?

    Many thanks!

  9. mattyrob
    Member
    Posted 3 years ago #

    @Matt,

    If you can still log into the WPPlugins.com site you may be able to update the PayPal address there. Otherwise it's a case of buying again and setting up from new I'm afraid. Sadly, I have no access at all to the payments system.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Subscribe2
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags