| Новости | FAQ | Авторы | Документация | В действии | Библиотека |
| Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
Ike 28.03.2006 14:52 / 28.03.2006 14:56
вот как сделано сейчас@add_queye[type;content_id]
$selectRecipients[^table::sql{SELECT id FROM recipients WHERE type = $type]
^selectRecipients.menu{
^void:sql{INSERT INTO spool (recipient_id, content_id) VALUES ($selectRecipients.id, $content_id)
}
@sent_maillist[]
$selectQueye[^table::sql{SELECT id, recipient_id, content_id FROM spool WHERE is_sent = 0 LIMIT 0, 100}]
^selectQueye.menu{
$selectAdress[^table::sql{SELECT email FROM recipients WHERE id = '$selectQueye.recipient_id'}]
$selectContent[^table::sql{SELECT header, text FROM dynamic_content WHERE id = '$selectQueye.content_id'}]
^if(def $selectAdress && def $selectContent){
^mail:send[
$.from[robot@site.ru]
$.x-mailer[Parser 3.2.1]
$.to[$selectAdress.email]
$.subject[Рассылка с сайта]
$.charset[$response:charset]
$.text[^untaint{$selectContent}]
]
^void:sql{UPDATE spool SET is_send = 1 WHERE id = $selectQueye.id
}
}
}