Changeset 2090930
- Timestamp:
- 05/19/2019 07:59:29 PM (7 years ago)
- Location:
- ng-mail2telegram/trunk
- Files:
-
- 2 edited
-
ng-mail2telegram.php (modified) (16 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ng-mail2telegram/trunk/ng-mail2telegram.php
r2090893 r2090930 5 5 * Description: Cross copy mail to telegram 6 6 * Author: Nikita Menshutin 7 * Version: 1. 07 * Version: 1.1 8 8 * Author URI: http://nikita.global 9 9 * … … 37 37 public function __construct() 38 38 { 39 $this->prefix = 'Ngmailtelegram'; 40 $this->version = '1.0'; 39 $this->prefix = 'Ngmailtelegram'; 40 $this->version = '1.1'; 41 load_plugin_textdomain( 42 $this->prefix, 43 false, 44 'ng-mail2telegram/languages' 45 ); 41 46 $this->pluginName = __('NG WP Mail to telegram', $this->prefix); 42 47 $this->options = get_option($this->prefix); … … 47 52 'title' => __('Bot token', $this->prefix), 48 53 'placeholder' => __('Bot token', $this->prefix), 49 'group' => ' bot settings',54 'group' => 'Bot settings', 50 55 'type' => 'text', 51 56 'required' => true, … … 54 59 'key' => 'botreset', 55 60 'title' => __('init webhooks for this site', $this->prefix), 56 'group' => ' bot settings',61 'group' => 'Bot settings', 57 62 'type' => 'checkbox', 58 63 'required' => false, … … 61 66 'key' => 'messagefilter', 62 67 'title' => __('Message filter', $this->prefix), 63 'group' => ' bot settings',68 'group' => 'Bot settings', 64 69 'type' => 'select', 65 70 'required' => false, 66 71 'args' => apply_filters( 67 72 $this->prefix . 'messageFilters', array( 68 'none' => __('Do not filter', $this->prefix),69 'subject' => __('Send subject only', $this->prefix),70 'html' => __('Send as html', $this->prefix),71 'short' => __('Cut long message', $this->prefix),72 'stripTags' => __('Strip html tags', $this->prefix),73 'file' => __('Send file', $this->prefix)73 'none' => 'Do not filter', 74 'subject' => 'Send subject only', 75 'html' => 'Send as html', 76 'short' => 'Cut long message', 77 'stripTags' => 'Strip html tags', 78 'file' => 'Send file' 74 79 ) 75 80 ) … … 81 86 } 82 87 } 88 add_action('init', array($this, 'loadTranslation')); 83 89 add_action('admin_init', array($this, 'settingsRegister')); 84 90 add_action('admin_init', array($this, 'processGetQuery')); … … 233 239 return $args; 234 240 } 235 241 236 242 /** 237 243 * Query filter - html content … … 318 324 unset($args['chat_id']); 319 325 unset($args['text']); 320 $linebreak = "\r\n";321 $boundary = $this->prefix . crc32($text);326 $linebreak = "\r\n"; 327 $boundary = $this->prefix . crc32($text); 322 328 $args['headers'] = array( 323 329 'Content-Type' => 'multipart/form-data; boundary=' . $boundary . '', … … 389 395 $current_user = wp_get_current_user(); 390 396 if ($current_user->ID == 0) { 391 wp_die(__($this->strings['notloggedin'] ));397 wp_die(__($this->strings['notloggedin'], $this->prefix)); 392 398 } 393 399 update_user_meta($current_user->ID, $this->prefix, $data['data']); … … 395 401 die( 396 402 __( 397 $this->strings['subscribed'] 403 $this->strings['subscribed'], 404 $this->prefix 398 405 ) 399 406 ); … … 689 696 690 697 $reply = (wp_remote_post($url, $this->args)); 691 $body =(wp_remote_retrieve_body($reply));698 $body = (wp_remote_retrieve_body($reply)); 692 699 693 700 … … 796 803 } 797 804 echo ">"; 798 echo $v;805 _e($v, $this->prefix); 799 806 echo '</option>'; 800 807 … … 815 822 echo $args['key'] . ']" '; 816 823 if (isset($args['placeholder'])) { 817 echo ' placeholder="' . $args['placeholder'] . '"'; 824 echo ' placeholder="'; 825 echo __($args['placeholder'], $this->prefix) . '"'; 818 826 } 819 827 if (isset($args['required']) && $args['required']) { … … 887 895 array( 888 896 get_available_languages(), 889 $this->strings 897 $this->strings, 898 $this->version 890 899 ) 891 900 ) … … 903 912 update_option( 904 913 $this->prefix . crc32($text . $shortslug), 905 __($text, $this->prefix ) . $lang914 __($text, $this->prefix, $this->prefix) 906 915 ); 907 916 } … … 927 936 928 937 return $text; 938 } 939 940 /** 941 * Loading language files 942 * 943 * @return void 944 */ 945 public function loadTranslation() 946 { 947 929 948 } 930 949 -
ng-mail2telegram/trunk/readme.txt
r2090900 r2090930 6 6 Requires at least: 3.6 7 7 Tested up to: 5.2 8 Stable tag: 1. 48 Stable tag: 1.1 9 9 Requires PHP: 5.6 10 Version: 1. 010 Version: 1.1 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html 13 14 == Description == 15 16 Create your own notification bot which will send emails to your dashboard users via telegram. 13 17 14 18 Sends all mails to telegram user via your own bot. 15 19 No need in many other plugins as you can use any email notifications which will be redirected to telegram 16 20 17 Developed by Nikita Menshutin18 19 21 [https://nikita.global/](https://nikita.global) 20 21 ** Set up **22 1. Register your own bot as described [https://core.telegram.org/bots#3-how-do-i-create-a-bot](here)23 2. Fill in plugin settings with your bot token24 3. Each user which has access to wp-admin should start chat with your bot and follow the subscription link25 22 26 23 Your website should support https. … … 33 30 to send notifications. 34 31 35 == Description ==36 37 Create your own notification bot which will send emails to your dashboard users via telegram.38 39 32 == Installation == 40 33 … … 46 39 4. Register your own bot as described [https://core.telegram.org/bots#6-botfather](here) 47 40 5. Fill in plugin settings with your bot token 41 6. Each user which has access to wp-admin should start chat with your bot and follow the subscription link 48 42 49 43 == Changelog == 50 44 45 = 1.1 (2019-05-19) = 46 * Better multilanguage support 51 47 52 48 = 1.0 (2019-05-16) =
Note: See TracChangeset
for help on using the changeset viewer.