[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> context,
<br> workflow_action,
<br> comment=comment)
<p>context.REQUEST[ 'RESPONSE' ].redirect( '%s/view?%s'
<br>
% ( context.absolute_url()
<br>
, 'portal_status_message=Status+changed.'
<br>
) )
<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> context.absolute_url()
+ \
<br> 'Comment:' + comment
+ '\n' + \
<br> '\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> (Object: content_status_modify_email)
<br> (Info: ({'script': <PythonScript instance at
01EAA9F8>, 'context': <Document instance at 01CF4810>, 'container':
<CMFSite instance at 01DC67D0>, 'traverse_subpath': []}, ('submit',
'', ''), {}, ('', '')))
<br> File Script (Python), line 27, in content_status_modify_email
<br> File D:\BUCKSF~1\lib\python\Products\MailHost\MailHost.py, line
221, in send
<br> (Object: MailHost)
<br> File D:\BUCKSF~1\bin\lib\smtplib.py, line 182, in __init__
<br> File D:\BUCKSF~1\bin\lib\smtplib.py, line 216, in connect
<br> File <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 <G.Benn@ftel.co.uk> [010628 12:41]:
<br>> portal_skins/custom/content_status_modify_email :
<br>>
<br>> context.portal_workflow.doActionFor(
<br>> context,
<br>> workflow_action,
<br>> comment=comment,
<br>> addressees=addressees)
# <<-- error with this
<p>> # host=context.MailHost
<br>> host = ? # need a hint here !</blockquote>
--
<br>Fujitsu Telecommunications Europe Ltd
<br>Tel: +44 (0)121 717 6441
<br>Fax: +44 (0)121 717 6018
<br>E-mail: G.Benn@ftel.co.uk
<br> </html>
--------------7BBB5CDAD0E3FDF12BB90B90--