| От | Jonathan Hedstrom |
|---|---|
| Тема | Re: Trigger email? |
| Дата | |
| Msg-id | 42250EA6.1070506@desc.org обсуждение исходный текст |
| Ответ на | Re: Trigger email? (Christopher Browne <cbbrowne@acm.org>) |
| Список | pgsql-general |
Christopher Browne wrote:
>cool_screen_name90001@yahoo.com (CSN) writes:
>
>
>>Is it possible to setup a trigger so that every time a
>>certain field is changed, an email is sent? Using
>>pl/pgsql.
>>
>>
>
>Something _like_ that is possible.
>
>
you can also do it directly with a trigger if you prefer:
CREATE TRIGGER alert_insert
AFTER INSERT OR UPDATE ON alert FOR EACH ROW
EXECUTE PROCEDURE alert_notify();
Where the alert_notify() function would then call pgmail() with a
meaningful subject and body etc -- see below
>What I would do instead is for the trigger to cause a record to be put
>into a table that might be called something like "submit_email".
>
>An asynchronous process (that might look for NOTIFY requests!) would
>then rummage thru submit_email to find messages it needs to send.
>
>
at which point you could then use pgmail() to send the email
http://sourceforge.net/projects/pgmail/
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера