Difference between revisions of "Freeside:1.9:Documentation:Developer/FS/Misc"

From Freeside
Jump to: navigation, search
(import from POD)
 
m (Edit via perl MediaWiki framework (1.13))
 
Line 12: Line 12:
  
 
==SUBROUTINES==
 
==SUBROUTINES==
; send_email OPTION => VALUE ...
+
; generate_email OPTION => VALUE ...
 
:Options:
 
:Options:
 +
:; from
 +
::Sender address, required
 +
:; to
 +
::Recipient address, required
 +
:; subject
 +
::email subject, required
 +
:; html_body
 +
::Email body (HTML alternative). Arrayref of lines, or scalar.
  
:''from'' - (required)
+
::Will be placed inside an HTML <BODY> tag.
 +
:; text_body
 +
::Email body (Text alternative). Arrayref of lines, or scalar.
  
:''to'' - (required) comma-separated scalar or arrayref of recipients
+
:Returns an argument list to be passsed to [[Freeside:1.9:Documentation:Developer/send email|send_email]].
 
+
; send_email OPTION => VALUE ...
:''subject'' - (required)
+
:Options:
 
+
:; from
:''content-type'' - (optional) MIME type for the body
+
::(required)
 
+
:; to
:''body'' - (required unless ''nobody'' is true) arrayref of body text lines
+
::(required) comma-separated scalar or arrayref of recipients
 
+
:; subject
:''mimeparts'' - (optional, but required if ''nobody'' is true) arrayref of MIME::Entity->build PARAMHASH refs or MIME::Entity objects. These will be passed as arguments to MIME::Entity->attach().
+
::(required)
 
+
:; content-type
:''nobody'' - (optional) when set true, send_email will ignore the ''body'' option and simply construct a message with the given ''mimeparts''. In this case, ''content-type'', if specified, overrides the default "multipart/mixed" for the outermost MIME container.
+
::(optional) MIME type for the body
 
+
:; body
:''content-encoding'' - (optional) when using nobody, optional top-level MIME encoding which, if specified, overrides the default "7bit".
+
::(required unless ''nobody'' is true) arrayref of body text lines
 
+
:; mimeparts
:''type'' - (optional) type parameter for multipart/related messages
+
::(optional, but required if ''nobody'' is true) arrayref of MIME::Entity->build PARAMHASH refs or MIME::Entity objects. These will be passed as arguments to MIME::Entity->attach().
 +
:; nobody
 +
::(optional) when set true, send_email will ignore the ''body'' option and simply construct a message with the given ''mimeparts''. In this case, ''content-type'', if specified, overrides the default "multipart/mixed" for the outermost MIME container.
 +
:; content-encoding
 +
::(optional) when using nobody, optional top-level MIME encoding which, if specified, overrides the default "7bit".
 +
:; type
 +
::(optional) type parameter for multipart/related messages
 
; send_fax OPTION => VALUE ...
 
; send_fax OPTION => VALUE ...
 
:Options:
 
:Options:
Line 52: Line 68:
 
; generate_ps FILENAME
 
; generate_ps FILENAME
 
:Returns an postscript rendition of the LaTex file, as a scalar. FILENAME does not contain the .tex suffix and is unlinked by this function.
 
:Returns an postscript rendition of the LaTex file, as a scalar. FILENAME does not contain the .tex suffix and is unlinked by this function.
 +
; generate_pdf FILENAME
 +
:Returns an PDF rendition of the LaTex file, as a scalar. FILENAME does not contain the .tex suffix and is unlinked by this function.
 
; print ARRAYREF
 
; print ARRAYREF
 
:Sends the lines in ARRAYREF to the printer.
 
:Sends the lines in ARRAYREF to the printer.
 +
; csv_from_fixed, FILEREF COUNTREF, [ LENGTH_LISTREF, [ CALLBACKS_LISTREF ] ]
 +
:Converts the filehandle referenced by FILEREF from fixed length record lines to a CSV file according to the lengths specified in LENGTH_LISTREF. The CALLBACKS_LISTREF refers to a correpsonding list of coderefs. Each should return the value to be substituted in place of its single argument.
 +
 +
:Returns false on success or an error if one occurs.
  
 
==BUGS==
 
==BUGS==

Latest revision as of 17:15, 6 February 2009

NAME

FS::Misc - Miscellaneous subroutines

SYNOPSIS

 use FS::Misc qw(send_email);

 send_email();

DESCRIPTION

Miscellaneous subroutines. This module contains miscellaneous subroutines called from multiple other modules. These are not OO or necessarily related, but are collected here to elimiate code duplication.

SUBROUTINES

generate_email OPTION => VALUE ...
Options:
from
Sender address, required
to
Recipient address, required
subject
email subject, required
html_body
Email body (HTML alternative). Arrayref of lines, or scalar.
Will be placed inside an HTML <BODY> tag.
text_body
Email body (Text alternative). Arrayref of lines, or scalar.
Returns an argument list to be passsed to send_email.
send_email OPTION => VALUE ...
Options:
from
(required)
to
(required) comma-separated scalar or arrayref of recipients
subject
(required)
content-type
(optional) MIME type for the body
body
(required unless nobody is true) arrayref of body text lines
mimeparts
(optional, but required if nobody is true) arrayref of MIME::Entity->build PARAMHASH refs or MIME::Entity objects. These will be passed as arguments to MIME::Entity->attach().
nobody
(optional) when set true, send_email will ignore the body option and simply construct a message with the given mimeparts. In this case, content-type, if specified, overrides the default "multipart/mixed" for the outermost MIME container.
content-encoding
(optional) when using nobody, optional top-level MIME encoding which, if specified, overrides the default "7bit".
type
(optional) type parameter for multipart/related messages
send_fax OPTION => VALUE ...
Options:
dialstring - (required) 10-digit phone number w/ area code
docdata - (required) Array ref containing PostScript or TIFF Class F document
-or-
docfile - (required) Filename of PostScript TIFF Class F document
...any other options will be passed to Fax::Hylafax::Client::sendfax
states_hash COUNTRY
Returns a list of key/value pairs containing state (or other sub-country division) abbriviations and names.
counties STATE COUNTRY
Returns a list of counties for this state and country.
state_label STATE COUNTRY_OR_LOCALE_SUBCOUNRY_OBJECT; card_types
Returns a hash reference of the accepted credit card types. Keys are shorter identifiers and values are the longer strings used by the system (see Business::CreditCard).
generate_ps FILENAME
Returns an postscript rendition of the LaTex file, as a scalar. FILENAME does not contain the .tex suffix and is unlinked by this function.
generate_pdf FILENAME
Returns an PDF rendition of the LaTex file, as a scalar. FILENAME does not contain the .tex suffix and is unlinked by this function.
print ARRAYREF
Sends the lines in ARRAYREF to the printer.
csv_from_fixed, FILEREF COUNTREF, [ LENGTH_LISTREF, [ CALLBACKS_LISTREF ] ]
Converts the filehandle referenced by FILEREF from fixed length record lines to a CSV file according to the lengths specified in LENGTH_LISTREF. The CALLBACKS_LISTREF refers to a correpsonding list of coderefs. Each should return the value to be substituted in place of its single argument.
Returns false on success or an error if one occurs.

BUGS

This package exists.

SEE ALSO

FS::UID, FS::CGI, FS::Record, the base documentation.

Fax::Hylafax::Client