Всем привет!
Есть плагин для WP называется newsletter
В нем есть отправка приветственного письма (одного)
Мне надо чтобы отправлялась серия из 5 штук при подписке
Количество писем я увеличил теперь не одно, а несколько
Добавил в файле optons.php еще одну форму для письма и так можно сделать
все пять писем.
Вот фрагменты кода файла
PHP:
скопировать код в буфер обмена
// пропуск части кода if (empty($controls->data['confirmed_text'])) { $controls->data['confirmed_text'] = $defaults['confirmed_text']; } if (empty($controls->data['confirmed_subject'])) { $controls->data['confirmed_subject'] = $defaults['confirmed_subject']; } if (empty($controls->data['confirmed_message'])) { $controls->data['confirmed_message'] = $defaults['confirmed_message']; } if (empty($controls->data['confirmed1_text'])) { $controls->data['confirmed1_text'] = $defaults['confirmed1_text']; } if (empty($controls->data['confirmed1_subject'])) { $controls->data['confirmed1_subject'] = $defaults['confirmed1_subject']; } if (empty($controls->data['confirmed1_message'])) { $controls->data['confirmed1_message'] = $defaults['confirmed1_message']; } $controls->data['confirmed_message'] = NewsletterModule::clean_url_tags($controls->data['confirmed_message']); $controls->data['confirmed_text'] = NewsletterModule::clean_url_tags($controls->data['confirmed_text']); $controls->data['confirmed1_message'] = NewsletterModule::clean_url_tags($controls->data['confirmed1_message']); $controls->data['confirmed1_text'] = NewsletterModule::clean_url_tags($controls->data['confirmed1_text']); $controls->data['confirmation_text'] = NewsletterModule::clean_url_tags($controls->data['confirmation_text']); $controls->data['confirmation_message'] = NewsletterModule::clean_url_tags($controls->data['confirmation_message']); $controls->data['confirmed_url'] = trim($controls->data['confirmed_url']); $controls->data['confirmed1_url'] = trim($controls->data['confirmed1_url']); $controls->data['confirmation_url'] = trim($controls->data['confirmation_url']); <!-- WELCOME/CONFIRMED EMAIL --> <tr valign="top"> <th> Welcome email<br /><small>The right place where to put bonus content link</small> </th> <td> <?PHP $controls->email('confirmed', 'wordpress', true); ?> <?PHP $controls->button('test-confirmed', 'Send a test'); ?> <p class="description"> Email sent to the user to confirm his subscription, the successful confirmation page, the welcome email. This is the right message where to put a <strong>{unlock_url}</strong> link to remember to the user where is the premium content (if any, main configuration panel). It's a good idea to add the <strong>{unsubscription_url}</strong> too and the <strong>{profile_url}</strong> letting users to cancel or manage/complete their profile. </p> </td> </tr> <!-- WELCOME/CONFIRMED EMAIL --> <tr valign="top"> <th> Welcome email<br /><small>The right place where to put bonus content link</small> </th> <td> <?PHP $controls->email('confirmed1', 'wordpress', true); ?> <?PHP $controls->button('test-confirmed1', 'Send a test'); ?> <p class="description"> Email sent to the user to confirm his subscription, the successful confirmation page, the welcome email. This is the right message where to put a <strong>{unlock_url}</strong> link to remember to the user where is the premium content (if any, main configuration panel). It's a good idea to add the <strong>{unsubscription_url}</strong> too and the <strong>{profile_url}</strong> letting users to cancel or manage/complete their profile. </p> </td> </tr> </table>
Теперь мне нужно, чтобы это второе письмо уходило новому подписчику спустя 10 минут после первого
Я пробовал поставить следующее
PHP:
скопировать код в буфер обмена
<!-- WELCOME/CONFIRMED EMAIL --> <tr valign="top"> <th> Welcome email<br /><small>The right place where to put bonus content link</small> </th> <td> add_action( 'true_my_hook', 'wp-email', 10, 1 ); <?PHP $controls->email('confirmed1', 'wordpress', true); if (wp_schedule_single_event ( time() + 300, 'true_my_hook',); ?>
Но не работает
Подскажите пожалуйста, как по Cron запустить отправку второго письма
Всем заранее спасибо!
|