Package bscw :: Package api :: Module ap_send_email
[hide private]

Module ap_send_email

Send email with attached objects
   returns recipients on success

API definition::

 API = (('to', 'ASCII string', 1),
        ('cc', 'ASCII string', 0),
        ('bcc', 'ASCII string', 0),
        ('subject', 'Unicode string', 1),
        ('message', 'Unicode string', 0),
        ('send_links', 'boolean', 0),
        ('object_ids', 'array', 0, [('item', 'ASCII string', 1)]))

(c) Fraunhofer FIT, 2003


Version: $Rev: 24488 $

Functions [hide private]
 
param_def()
return the parameter definition
 
do_it(request, to, cc, bcc, subject, message='', send_links=True, object_ids=[])
send objects and text via email to: email addresses of recipients, comma or newline separated cc, bcc: dito, optional.
 
ap_send(request, toline, ccline, bccline, subject, message, sel_objs, as_link=1, exp_date=0, language=None, show_hints=True)
send set of objects as link or as attachment to recipients...
Variables [hide private]
  log_mail = __import__('logging').getLogger('mail')
  __package__ = None
Function Details [hide private]

do_it(request, to, cc, bcc, subject, message='', send_links=True, object_ids=[])

 
send objects and text via email
to: email addresses of recipients, comma or newline separated
cc, bcc: dito, optional. Default: ''
subject: subject string.
message: message body, optional. Default: ''
send_links: send documents as links only.
    If TRUE: send objects as links to BSCW objects with
        a temporary token for access by non-members.
        Will only work, if all objects are of type "Document".
        Otherwise, "send_links" is assumed to be FALSE.
    If FALSE: all objects will be sent as multipart
        email message.
    Default: TRUE
object_ids_: list of IDs of BSCW objects to be sent via email.

ap_send(request, toline, ccline, bccline, subject, message, sel_objs, as_link=1, exp_date=0, language=None, show_hints=True)

 
send set of objects as link or as attachment to recipients
as_link can be either 0 (send as attachment) or 1 (send as link to all)
OR (as used in op_send_email)
'link_members': send as link, but only to members (with get access)
'link_all': send as link to all (may create token links)
'attached': send as attachment (to all)
will set 'SendTokenEvent' on objects if disclosed to non-members
may raise errors (as response)
returns a list - either empty (all OK)
 or list of strings: hints to show to the user
  (like invalid addresses or send limit exceeded)
 or list of objects: rejected objects (could not be archived)
  [later may only happen if sent as attachment]
Note: in case of hints NO message is sent (unless show_hints is False)
      whereas in case of rejected objects the mail(s) are send/queued!