s4

changeset 690:87ce0eef5872

GrpAction mail sent one by one
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 19 May 2020 08:53:33 +0900
parents 13fb1392d2f2
children 39879f81afc8
files s4-funcs.sh
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/s4-funcs.sh	Mon May 18 19:15:11 2020 +0900
     1.2 +++ b/s4-funcs.sh	Tue May 19 08:53:33 2020 +0900
     1.3 @@ -2699,19 +2699,22 @@
     1.4  	)
     1.5        fi
     1.6        rcpts="`email4groupbyuid "$grp" $usel` $fromad$supprcpt"
     1.7 +      rcpts=`echo $rcpts|tr ' ' '\n'|sort|uniq`
     1.8        subj="${subj:-$gecos さんからのメッセージ}"
     1.9        REPLYTO=$replyto
    1.10 -      SMAIL_TO="$user $fromad$supprcpt"
    1.11        MAIL_FROM=$mail_from
    1.12        export REPLYTO SMAIL_TO MAIL_FROM
    1.13        err "GrpActionSend: user=[$user], MAIL_FROM=[$mail_from], rcpts=[$rcpts], REPLYTO=[$replyto}"
    1.14 -      if [ -n "$afiles" ];then
    1.15 -	./sendmultipart.sh -t "$rcpts" -s "$subj" -f "$mail_from" $afiles
    1.16 -      else
    1.17 -	smail "$rcpts" "$subj"
    1.18 -      fi <<EOF
    1.19 +      for r in $rcpts; do
    1.20 +	SMAIL_TO="$r $user $fromad"
    1.21 +	if [ -n "$afiles" ];then
    1.22 +	  ./sendmultipart.sh -t "$r" -s "$subj" -f "$mail_from" $afiles
    1.23 +	else
    1.24 +	  smail "$r" "$subj"
    1.25 +	fi <<EOF
    1.26  ${preface:+$preface$nl}$text
    1.27  EOF
    1.28 +      done
    1.29        if [ $? = 0 ]; then
    1.30  	echo "Note: 以下のメンバーにメッセージを送信しました。" | html p
    1.31  	sql="select coalesce(b.val, a.name) from