[Zope-CMF] DCWorkflow emailing review invites

Geoff Benn G.Benn@ftel.co.uk
Thu, 28 Jun 2001 13:04:00 +0100


--------------7BBB5CDAD0E3FDF12BB90B90
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi Seb,

Current code:

     (Parameter List :workflow_action, comment='', addressees='')

     context.portal_workflow.doActionFor(
         context,
         workflow_action,
         comment=comment)

     context.REQUEST[ 'RESPONSE' ].redirect( '%s/view?%s'
                        % ( context.absolute_url()
                          , 'portal_status_message=Status+changed.'

                          ) )

     host=context.MailHost

     mto='geoff@ftel.co.uk;' + addressees
     mfrom='geoff@ftel.co.uk'
     msubject='Review request'
     mailtext='Submit for review:\n' + \
               context.absolute_url() + \
              'Comment:' + comment + '\n' + \
              '\n'

     host.send(mailtext, mto, mfrom, msubject)

gives:

     Error Type: error
     Error Value: host not found
     ...
     File
     D:\BucksfizzZope232\lib\python\Products\PythonScripts\PythonScript.py,
     line 336, in _exec
         (Object: content_status_modify_email)
         (Info: ({'script': <PythonScript instance at 01EAA9F8>,
     'context': <Document instance at 01CF4810>, 'container':
     <CMFSite instance at 01DC67D0>, 'traverse_subpath': []},
     ('submit', '', ''), {}, ('', '')))
       File Script (Python), line 27, in
     content_status_modify_email
       File D:\BUCKSF~1\lib\python\Products\MailHost\MailHost.py,
     line 221, in send
         (Object: MailHost)
       File D:\BUCKSF~1\bin\lib\smtplib.py, line 182, in __init__
       File D:\BUCKSF~1\bin\lib\smtplib.py, line 216, in connect
       File <string>, line 1, in connect

I guess this is now a problem with being able to email off the machine ?
MailHost has our SMTP mail server name.

I've realised where I went wrong with addressees, bolded above.

Thanks,
Geoff

seb bacon wrote:

> Geoff,
>
> what's the error?
>
> Are you adding addressees as a parameter at the top of the python
> script?
>
> You want context.MailHost, I think.
>
> seb
>
> * Geoff Benn <G.Benn@ftel.co.uk> [010628 12:41]:
> > portal_skins/custom/content_status_modify_email :
> >
> >      context.portal_workflow.doActionFor(
> >          context,
> >          workflow_action,
> >          comment=comment,
> >          addressees=addressees) # <<-- error with this
>
> >      # host=context.MailHost
> >      host = ? # need a hint here !

--
Fujitsu Telecommunications Europe Ltd
Tel:  +44 (0)121 717 6441
Fax:  +44 (0)121 717 6018
E-mail: G.Benn@ftel.co.uk


--------------7BBB5CDAD0E3FDF12BB90B90
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi Seb,
<p>Current code:
<blockquote>(Parameter List :workflow_action, comment=''<b>, addressees=''</b>)
<p>context.portal_workflow.doActionFor(
<br>&nbsp;&nbsp;&nbsp; context,
<br>&nbsp;&nbsp;&nbsp; workflow_action,
<br>&nbsp;&nbsp;&nbsp; comment=comment)
<p>context.REQUEST[ 'RESPONSE' ].redirect( '%s/view?%s'
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
% ( context.absolute_url()
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
, 'portal_status_message=Status+changed.'
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
) )
<p>host=context.MailHost
<p>mto='geoff@ftel.co.uk;' + addressees
<br>mfrom='geoff@ftel.co.uk'
<br>msubject='Review request'
<br>mailtext='Submit for review:\n' + \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; context.absolute_url()
+ \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Comment:' + comment
+ '\n' + \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '\n'
<p>host.send(mailtext, mto, mfrom, msubject)</blockquote>
gives:
<blockquote>Error Type: error
<br>Error Value: host not found
<br>...
<br>File D:\BucksfizzZope232\lib\python\Products\PythonScripts\PythonScript.py,
line 336, in _exec
<br>&nbsp;&nbsp;&nbsp; (Object: content_status_modify_email)
<br>&nbsp;&nbsp;&nbsp; (Info: ({'script': &lt;PythonScript instance at
01EAA9F8>, 'context': &lt;Document instance at 01CF4810>, 'container':
&lt;CMFSite instance at 01DC67D0>, 'traverse_subpath': []}, ('submit',
'', ''), {}, ('', '')))
<br>&nbsp; File Script (Python), line 27, in content_status_modify_email
<br>&nbsp; File D:\BUCKSF~1\lib\python\Products\MailHost\MailHost.py, line
221, in send
<br>&nbsp;&nbsp;&nbsp; (Object: MailHost)
<br>&nbsp; File D:\BUCKSF~1\bin\lib\smtplib.py, line 182, in __init__
<br>&nbsp; File D:\BUCKSF~1\bin\lib\smtplib.py, line 216, in connect
<br>&nbsp; File &lt;string>, line 1, in connect</blockquote>
I guess this is now a problem with being able to email off the machine
? MailHost has our SMTP mail server name.
<p>I've realised where I went wrong with addressees, bolded above.
<p>Thanks,
<br>Geoff
<p>seb bacon wrote:
<blockquote TYPE=CITE>Geoff,
<p>what's the error?
<p>Are you adding addressees as a parameter at the top of the python
<br>script?
<p>You want context.MailHost, I think.
<p>seb
<p>* Geoff Benn &lt;G.Benn@ftel.co.uk> [010628 12:41]:
<br>> portal_skins/custom/content_status_modify_email :
<br>>
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; context.portal_workflow.doActionFor(
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; context,
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; workflow_action,
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comment=comment,
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addressees=addressees)
# &lt;&lt;-- error with this
<p>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # host=context.MailHost
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; host = ? # need a hint here !</blockquote>
--
<br>Fujitsu Telecommunications Europe Ltd
<br>Tel:&nbsp; +44 (0)121 717 6441
<br>Fax:&nbsp; +44 (0)121 717 6018
<br>E-mail: G.Benn@ftel.co.uk
<br>&nbsp;</html>

--------------7BBB5CDAD0E3FDF12BB90B90--