WordPress.org

Ready to get started?Download WordPress

Forums

WP Post Notifier For All
Great plugin! Feature suggestions and tweaked code (2 posts)

  1. wallberg
    Member
    Posted 2 years ago #

    Hi Fayçal!

    Thanks for a very nice plugin! It is simple and efficient, exactly the way it should be. I hope you will maintain and update it.

    I have tweaked the code to fit my purposes and I'd like to suggest two features, namely:

    1) to include the complete post content using a [CONTENT] tag, something like this:

    $email_pnfa_body = str_replace('[CONTENT]', htmlspecialchars_decode($post->post_content), $email_pnfa_body);

    2) to allow for plain text emails (the admin then needs to remove HTML markup from the 'Email "Body" Template'):

    $message_headers .= "Content-type: text/plain; charset=UTF-8\r\n";
    $message .= strip_tags($email_pnfa_body);

    In the current version of the plugin, the saved 'Email "Body" Template' has problems with international characters such as ÅÄÖåäö in the explicit template text (not the text inserted via the tags though), which are saved using the corresponding codes such as "å" for "å". Not all email clients handle these codes nicely.

    In my version of the plugin I have manually added this blob of code to handle these characters:

    $message = str_replace('å','å', $message);
            $message = str_replace('ä','ä', $message);
            $message = str_replace('ö','ö', $message);
    
            $message = str_replace('Å','Å', $message);
            $message = str_replace('Ä','Ä', $message);
            $message = str_replace('Ö','Ö', $message);
    
            $message = str_replace(' ','', $message);

    It would be nice if these was not needed. Can you perhaps use some different field in the database backend for the template that stores the characters correctly or add code that decodes the message so that the correct characters are indeed inserted before they are sent?

    I do not think pasting my tweaked version of the complete wp-post-notifier-for-all.php here is appropriate but I can send it over email if it helps at all.

    Best regards and thanks again for a great plugin!

    http://wordpress.org/extend/plugins/wp-post-notifier-for-all/

  2. wallberg
    Member
    Posted 2 years ago #

    Dupe removed by the author

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic