---
site_name: WPlama
site_description: "Správa, opravy a vývoj WordPress webů a e-shopů"
site_url: https://www.wplama.cz
contact_email: info@wplama.cz

title: Plugin Email-reminder
url: https://www.wplama.cz/dotaz/plugin-email-reminder/
date: 2018-02-09
modified: 2018-02-22
type: dwqa-question
---

[Pluginy](https://www.wplama.cz/poradna/?tema=pluginy-3)

# Plugin Email-reminder

HY **Hynek** 9. 2. 2018 [7 odpovědí](https://www.wplama.cz/dotaz/plugin-email-reminder/#odpovedi)

Dobrý den,
našel jsem si plugin, který umí v určitý čas odeslat na zadanou adresu informační mail. Vše funguje, ale obsah mailu přijde v tomto tvaru

> `<p>This message is a reminder created on Friday, February 2, 2018</p>
> <p><strong>[/b]REMINDER:[b]</strong><br />
> Reminder</p><br />
> <p>This
> reminder was sent using <a
> href="http://pogidude.com/email-reminder/">Email Reminder
> plugin</a> by <a href="http://pogidude.com/about/">Pogidude
> Web Studio</a></p`

Anglickou verzi vím jak přeložit, ale nevím jak odstranit html značky z těla mailu.
Zde je nejspíše asi obsah souboru kde se tvoří tělo mailu.

> `<?php`
>
>
>
> class PDER{
>
>
>
> /**
> * Get Ereminders
> *
>
> * Selects all 'ereminders' custom post types from the 'posts' table
> whose 'post_date' is less than $date and 'post_status' = draft returns
> rows as a numerically indexed array of objects. Uses
> $wpdb->get_results() function to fetch the results from the database.
> *
> * @param string $date date in YYYY-MM-DD H:i:s format. Defaults to current local time
> * @param string $status draft|publish. corresponds to scheduled and sent reminders respectively
> * @return array numerically indexed array of row objects
> */
> public function get_ereminders( $date = '', $status = 'draft' ) {
> global $wpdb;
>
> if( $date == '' ){
> $date = current_time( 'mysql',0 );
> }
>
> if( $status == 'sent' )
> $status = 'publish';
> elseif( $status == 'scheduled' )
> $status = 'draft';
>
> $ereminders = $wpdb->get_results( $wpdb->prepare("
> SELECT *
> FROM {$wpdb->posts}
> WHERE post_date < %s
> AND post_type = 'ereminder'
> AND post_status = %s
> ORDER BY post_date ASC
> ", $date, $status) );
>
> return $ereminders;
> }//get_ereminders
>
> /**
> * Send Ereminders
> */
> public static function send_ereminders(){
>
>
>
> //credits
>
> $credits = sprintf(__('This reminder was sent using <a
> href="%s">Email Reminder plugin</a> by <a
> href="%s">Pogidude
> Web Studio</a>', 'email-reminder'), 'http://pogidude.com/email-reminder/', 'http://pogidude.com/about/');
>
> //get ereminders
> $pd = new PDER;
> $ereminders = $pd->get_ereminders();
>
> foreach( $ereminders as $ereminder ){
>
> $subject = __('[Reminder] ', 'email-reminder') . $ereminder->post_title;
> $to = $ereminder->post_excerpt;
>
> //use the email of the user who scheduled the reminder
> $author = get_userdata( $ereminder->post_author );
> $author_email = $author->user_email;
>
>
>
> $headers = __('From: Email Reminder', 'email-reminder') . "<{$author_email}>\r\n" . "Content-Type:
> text/html;\r\n";
>
> $creation_date = date( 'l, F j, Y', strtotime( $ereminder->post_date ) );
> $message = "<p>" . sprintf(__('This message is a reminder created on %s', 'email-reminder'),
> $creation_date) .
> "</p>\n";
> $message .= '<p><strong>' . __('REMINDER:', 'email-reminder') . "</strong><br />\n";
> $message .= $ereminder->post_content . "</p><br />\n";
> $message .= "<p>{$credits}</p>";
>
> $email_result = wp_mail( $to, $subject, $message, $headers );
>
> //$email_result = wp_mail( '[[email protected]](https://www.wplama.cz/cdn-cgi/l/email-protection)', 'Test
> Reminder', 'message', 'From: Email Reminder
> <[[email protected]](https://www.wplama.cz/cdn-cgi/l/email-protection)>' );
>
>
> if( $email_result ){//wp_mail() processed the request successfully
> //set post to 'publish' or delete the post
>
> $args = array( 'ID' => $ereminder->ID, 'post_status'
> => 'publish', 'post_date' => $ereminder->post_date,
> 'post_date_gmt' => $ereminder->post_date_gmt, 'post_modified'
> => current_time('mysql',0), 'post_modified_gmt' =>
> current_time('mysql',1) );
>
> wp_update_post( $args );
> //wp_delete_post( $ereminder->ID );
> }
>
> }
> }
>
> }

Poradí mi někdo jak toto upravit, aby v těle mailu byl normální text bez značek
Děkuji Hynek

## Odpovědi 7

WP **Zdeněk Vojáček, WPlama** 14. 2. 2018 Odpověď WPlama

Dobrý den Hynku,
spíš než v tomhle bych chybu hledal v hlavičce emailu tam se povoluje HTML. Koukněte se tam kde se to odesílá jestli je tam něco takového 'Content-Type: text/html; charset=UTF-8'. Popřípadě se podívejte do nastavení pluginu jestli tam někde není povolení HTML v těle emailu.

Zdeněk

HY **Hynek** 14. 2. 2018

Našel jsem toto
$headers = __('From: Email Reminder', 'email-reminder') . "<{$author_email}>\r\n" . "Content-Type:
text/html;\r\n";
co přesně zde mám upravit? děkuji

WP **Zdeněk Vojáček, WPlama** 20. 2. 2018 Odpověď WPlama

Tady je asi vše v pořádku protože text/html tam je. Nemůže Vám to dělat emailový klient? Někdy když text obsahuje HTML tak se zablokuje jeho výpis. Zkuste si to poslat na jiný email a otevřít to v jiném klientu. Někdy lze přímo u emailu povolit html.

HY **Hynek** 21. 2. 2018

Tak vyzkoušel jsem Outlook (android), Thunderbirda, google zobrazení je všude stejný s HTML značkama. Bohužel nastavení pluginu žádné není :-( Nebo kdyby věděl o něčem co u umí automaticky v určitý čas odeslat mail s upozorněním.
Děkuji

WP **Zdeněk Vojáček, WPlama** 22. 2. 2018 Odpověď WPlama

Bohužel plugin s podobnou fcí neznám. Navíc tento je hodně starý a tvoří velké bezpečnostní riziko. K čemu ho používáte? Nedal by se nahradit něčím jiným?

HY **Hynek** 22. 2. 2018

Odesílám upomínku mail lidem, kteří mají službu, která se opakuje. Asi to udělám přes google kalendář pokud to půjde.

WP **Tomáš Cirkl, WPlama** 11. 1. 2024 Odpověď WPlama

Dobrý den Hynku,
spíš než v tomhle bych chybu hledal v hlavičce emailu tam se povoluje HTML. Koukněte se tam kde se to odesílá jestli je tam něco takového ‚Content-Type: text/html; charset=UTF-8‘. Popřípadě se podívejte do nastavení pluginu jestli tam někde není povolení HTML v těle emailu.

Přidat odpověď

Přidat odpověď [Zrušit odpověď na komentář](https://www.wplama.cz/dotaz/plugin-email-reminder/#respond)