Hi again,<br><br>This how i have solved it now, it probably could be done in a better way but at least it seems to be working:<br><br>I have added the send mail function twice to be able to get the full information to the blog admin but only the &quot;comment added&quot; and URL to the commentators.
<br><br>Also i have moved the send notification flag to commentators part as the blog admin always should be notified but now i can turn off the commentator notification.<br><br>I only have one small problem left, with this aproach the commentator gets a notification mail even when he makes the comment himself, is there anyone who knows an easy way to fix that, it would be very welcome :) .
<br><br><br>---------------------------------------------------------------------------------------------<br><br>#Send notify mail to blog admin<br><br>try:<br>&nbsp;&nbsp;&nbsp; to_addr&nbsp;&nbsp; = context.getNotify_to()<br>&nbsp;&nbsp;&nbsp; from_addr = context.getNotify_from
()<br>&nbsp;&nbsp;&nbsp; msgbody = context.translate(&#39;comment_notify_body&#39;)<br>&nbsp;&nbsp;&nbsp; elements = {}<br>&nbsp;&nbsp;&nbsp; for k in (&#39;title&#39;,&#39;author&#39;,&#39;url&#39;,&#39;body&#39;):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if REQUEST.form.has_key(k):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elements[k] = 
REQUEST.form[k]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elements[k] = &#39;&#39;<br>&nbsp;&nbsp;&nbsp; elements[&#39;post_ip&#39;] = REQUEST.getClientAddr()<br>&nbsp;&nbsp;&nbsp; elements[&#39;entry_url&#39;] = context.absolute_url()<br>&nbsp;&nbsp;&nbsp; msgbody = msgbody % (elements)
<br>&nbsp;&nbsp;&nbsp; msgsubject = context.translate(&#39;comment_notify_title&#39;)<br>&nbsp;&nbsp;&nbsp; mgsheader = &quot;&quot;&quot;To: %s<br>From: %s<br>Mime-Version: 1.0<br>Content-Type: text/plain; Charset=utf-8<br><br>&quot;&quot;&quot; % (to_addr,from_addr)
<br>&nbsp;&nbsp;&nbsp; cbtool.send_mail(mgsheader+msgbody, to_addr, from_addr, msgsubject)<br><br>&nbsp;&nbsp;&nbsp; if context.getSend_comment_notification():<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Get email addresses<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; com_list = context.getComment()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addr_list = []
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for com in com_list:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not addr_list.count(com.getEmail()):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addr_list.append(com.getEmail())<br><br>&nbsp;&nbsp;&nbsp; #Send notify mail if need to commentators<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for addr in addr_list:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to_addr = addr<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from_addr = context.getNotify_from()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msgbody = context.absolute_url()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msgsubject = context.translate(&#39;comment_notify_title&#39;)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mgsheader = &quot;&quot;&quot;To: %s<br>From: %s<br>Mime-Version: 1.0<br>Content-Type: text/plain; Charset=utf-8<br><br>&quot;&quot;&quot; % (to_addr,from_addr)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cbtool.send_mail(mgsheader+msgbody, to_addr, from_addr, msgsubject)
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; except Exception,e:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log( &#39;COREBlog2/cbaddComment: &#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;Some exception occured, %s&#39; % e )<br><br>&nbsp;&nbsp; <br>except Exception,e:<br>&nbsp;&nbsp;&nbsp; log( &#39;COREBlog2/cbaddComment: &#39;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;Some exception occured, %s&#39; % e )<br><br>---------------------------------------------------------------------------------------------<br><br><br><br><br><br><div><span class="gmail_quote">On 12/21/06, 
<b class="gmail_sendername">Niklas</b> &lt;<a href="mailto:nekstrand@gmail.com">nekstrand@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanx again,<br><br>I have not had the time to check the last code but i&#39;m sure it will work fine.<br><br>The checkbox is also fine to leave out, the only problem would be if someone gets mail and tells me he don&#39;t like to have it, but they will have to live with it. I always have the possibility to erase their address in the comment.
<br><br>Is it ok if i add a feature request and adds this sample code? and adds you to the reference Mr NAKAI?<br><span class="sg"><br>/Niklas</span><div><span class="e" id="q_10fa3c52b9d5ea15_2"><br><br><br><br><div><span class="gmail_quote">
On 12/20/06, <b class="gmail_sendername">Yusuke NAKAI
</b> &lt;<a href="mailto:nyusuke@nagosui.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">nyusuke@nagosui.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>&gt; I tried to find where to change to BCC but could not find the right<br>&gt; reference, i agree with this beeing a problem, is it hard to change?.<br><br>Notification mail is send by cbtool.send_mail() method:<br>

<br>--------------------------------------------------<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mgsheader = &quot;&quot;&quot;To: %s<br>From: %s<br>Mime-Version: 1.0<br>Content-Type: text/plain; Charset=utf-8<br><br>&quot;&quot;&quot; % (to_addr,from_addr)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cbtool.send_mail(mgsheader+msgbody, to_addr, from_addr, ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^^^^^^^^^^^^^^^^<br>--------------------------------------------------<br><br>This method is defined in COREBlog2/COREBlogTool.py from line 238. And
<br>this uses send() method of SecureMailHost. But this method can&#39;t handle BCC.<br><br>To handle BCC, using secureSend() method of SecureMailHost is needed.<br>But this approach seems to be a bit trouble. How about taking separate
<br>sending approach?<br><br>To send mail separately, you can use &#39;for&#39; loop for addr_list.<br>For example:<br><br>--------------------------------------------------<br>#Send notify mail if need<br>if context.getSend_comment_notification

():<br>&nbsp;&nbsp;&nbsp;&nbsp; try:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for addr in addr_list:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to_addr = addr<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>--------------------------------------------------<br><br><br>&gt; This might be to ask for to much but i will still ask, is it a hard job
<br>&gt; to add a check box (notify me when furter comments are added to this<br>&gt; post) in the comment form and have the&nbsp;&nbsp;mails selected bu this check box?<br><br>It seems to be hard. At least beyond my reach.<br><br>

<br>Regards,<br><br>--<br>Yusuke NAKAI<br><br>mail: <a href="mailto:nyusuke@nagosui.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">nyusuke@nagosui.org</a><br>web : <a href="http://nagosui.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://nagosui.org</a><br>_______________________________________________
<br>COREblog-en mailing list<br><a href="mailto:COREblog-en@postaria.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">COREblog-en@postaria.com</a><br><a href="http://postaria.com/mailman/listinfo/coreblog-en" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://postaria.com/mailman/listinfo/coreblog-en</a><br>
Unsubscription writing to <a href="mailto:coreblog-en-leave@postaria.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">coreblog-en-leave@postaria.com</a><br></blockquote></div><br><br clear="all">
<br></span></div><div><span class="e" id="q_10fa3c52b9d5ea15_3">-- <br>With best regards / med vänlig hälsning<br><br>Niklas

</span></div></blockquote></div><br><br clear="all"><br>-- <br>With best regards / med vänlig hälsning<br><br>Niklas