From 0d482aa858c3044f032d47a20c29a0767f6019d2 Mon Sep 17 00:00:00 2001 From: fukachan Date: Wed, 30 Nov 2005 21:58:04 +0000 Subject: add recipes on autoreply --- fml/doc/ja/tutorial/customize/autoreply.sgml | 12 +- .../ja/tutorial/customize/recipes.autoreply.sgml | 125 +++++++++++++++++++++ fml/doc/ja/tutorial/include/chapters.ent | 3 +- 3 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 fml/doc/ja/tutorial/customize/recipes.autoreply.sgml (limited to 'fml') diff --git a/fml/doc/ja/tutorial/customize/autoreply.sgml b/fml/doc/ja/tutorial/customize/autoreply.sgml index d1846df8..1f85c95f 100644 --- a/fml/doc/ja/tutorial/customize/autoreply.sgml +++ b/fml/doc/ja/tutorial/customize/autoreply.sgml @@ -1,5 +1,5 @@ @@ -44,4 +44,14 @@ $curproc->stop_this_process(); つまり、なにも実行されなくなるというわけです。 + + + + レシピ’s + + +§.customize.autoreply.recipes; + + + diff --git a/fml/doc/ja/tutorial/customize/recipes.autoreply.sgml b/fml/doc/ja/tutorial/customize/recipes.autoreply.sgml new file mode 100644 index 00000000..4625fd68 --- /dev/null +++ b/fml/doc/ja/tutorial/customize/recipes.autoreply.sgml @@ -0,0 +1,125 @@ + + + + + + + + + +サービス案内を自動で送り返す + + + + + +ガイドを送り返す仕組みを利用すると良いでしょう。デフォルトではテンプレー +トのガイド案内が使われますが、各MLのホームディレクトリに guide ファ +イルをおけばそれを送り返してくれます。 + + + +「メールの内容にかかわらず常にガイドを送り返す」には、もうひと捻り必要 +です。 + + + +このためには次のように HOOK で常に guide コマンドを実行するようにする +とよいでしょう。なお通常の処理は行なわないようにしています。 + + +$distribute_run_start_hook = q{ + + # guide コマンドを呼び出します。 + # guide コマンドの内容は汎用のメールキューシステムに渡されます。 + use FML::Command; + my $dispatch = new FML::Command; + my $context = $curproc->command_context_init("guide"); + $dispatch->guide($curproc, $context); + + # 通常の処理を行ないません。 + $curproc->stop_this_process(); + +}; + +# コマンドメールでも同じくガイドを送り返すように +$command_mail_run_start_hook = $distribute_run_start_hook; + + +&fml4; と異なり、配送用とコマンドメール用それぞれのプロセスごとにHOOK +が分かれていることに注意して下さい。このため最後に同じ内容のコマンドメー +ル用の HOOK も定義しています(コピーしています)。 + +$command_mail_run_start_hook = $distribute_run_start_hook; + + + + + + + + + + + + + +お礼”も”返す意見受け付け用ML + + + + + +前レシピに似ていますが、少し違います。 + + + +たとえば意見受付用のMLを考えてみましょう。 +このMLに意見を送ってくれた人には、 +とりあえずお礼の返事 +「ご意見ありがとうございました。返事はしばらく待ってね。」を出し、 +メールは関係者に配送します。 +よって、 +(1) だれでも投稿できて、 +(2) お礼を常に出し、 +(3) さらに普通のMLとして動作する、 +ように設定します。 + + + + +[config.cf] + +article_post_restrictions = permit_anyone + +=cut + +$distribute_run_start_hook = q{ + my $cred = $curproc->credential(); + my $sender = $cred->sender(); + + # MLのメンバーでないならガイドを送り返します。 + # MLのメンバーに対しては普通のMLとなります。 + unless ($cred->is_member($sender)) { + + # guide コマンドを呼び出します。 + use FML::Command; + my $dispatch = new FML::Command; + my $context = $curproc->command_context_init("guide"); + $dispatch->guide($curproc, $context); + } + +}; + + + + + + + + + + + diff --git a/fml/doc/ja/tutorial/include/chapters.ent b/fml/doc/ja/tutorial/include/chapters.ent index 24bec2b7..a727e632 100644 --- a/fml/doc/ja/tutorial/include/chapters.ent +++ b/fml/doc/ja/tutorial/include/chapters.ent @@ -1,5 +1,5 @@ @@ -71,6 +71,7 @@ + -- cgit v1.2.1