Plugin Directory

Changeset 1869302


Ignore:
Timestamp:
05/05/2018 09:52:49 PM (8 years ago)
Author:
abjelosevic
Message:

new version 1.10

Location:
ab-post-to-email
Files:
19 added
2 edited

Legend:

Unmodified
Added
Removed
  • ab-post-to-email/trunk/ab-post-to-email-plugin.php

    r1862870 r1869302  
    22   /*
    33   Plugin Name: AB Post To Email
    4    Plugin URI: http://aleksandar.bjelosevic.info/abptofb
     4   Plugin URI: http://aleksandar.bjelosevic.info/abptoem
    55   Description: This plugin send automatic email to all subscriber's when new post is out,
    6    Version: 1.00
     6   Version: 1.10
    77   Author: Aleksandar Bjelosevic
    88   Author URI: http://aleksandar.bjelosevic.info
     
    1919   );
    2020   
    21 
     21$file = file_get_contents('files/template.html', FILE_USE_INCLUDE_PATH);
    2222
    2323   $subscribers = get_users($args1); 
     
    2727        $post_url = get_permalink( $post_id );
    2828        $url = get_bloginfo('url');
    29         $post_title = get_the_title( $post_id );
    30         $author   = get_userdata($post->post_author);
     29        $img_post = get_the_post_thumbnail_url($post_id, 'medium_large');
     30        $post_title = get_the_title( $post_id );
     31        $author = get_userdata($post->post_author);
     32        $first_name = $author->first_name;
     33        $tekstclanka= wp_trim_words(get_post_field('post_content', $post_id), 30);
     34        $linkdoclanka=$post_url;
     35        $last_name = $author->last_name;
    3136        $subject  = 'New post on site-'.$url;
    32         $message  = "Hello, this is new post: ";
    33         $message .= " <a href='". $post_url. "'>'".$post_title."'</a>\n\n";
     37        $message = str_replace("[naslovclanka]",$post_title,$file);
     38        $file = str_replace("[nazivsajta]",$url,$message);
     39        $message = str_replace("[postimage]", $img_post,$file);
     40        $file=str_replace("[linkdoclanka]",$linkdoclanka,$message);
     41        $message = str_replace("[tekstclanka]",$tekstclanka,$file);
    3442        $headers = array('Content-Type: text/html; charset=UTF-8');
    3543
  • ab-post-to-email/trunk/readme.txt

    r1862870 r1869302  
    55Requires at least: 3.8
    66Tested up to: 4.95
    7 Stable tag: 1.00
     7Stable tag: 1.10
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl.html
     
    2323== Changelog ==
    2424
     25= V1.10 =
     26Template added, email with preview of post added
    2527
    2628= V1.00 =
Note: See TracChangeset for help on using the changeset viewer.