FS::Misc - Miscellaneous subroutines
use FS::Misc qw(send_email); send_email();
Miscellaneous subroutines. This module contains miscellaneous subroutines called from multiple other modules. These are not OO or necessarily related, but are collected here to eliminate code duplication.
- send_email OPTION => VALUE ...
- (required) comma-separated scalar or arrayref of recipients
- (optional) MIME type for the body
- (required unless nobody is true) arrayref of body text lines
- (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().
- (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) when using nobody, optional top-level MIME encoding which, if specified, overrides the default "7bit".
- (optional) type parameter for multipart/related messages
- (optional) FS::cust_main key; if passed, the message will be logged (if logging is enabled) with this custnum.
- (optional) FS::msg_template key, for logging.
- generate_email OPTION => VALUE ...
- Sender address, required
- Recipient address, required
- Blind copy address, optional
- email subject, required
- Email body (HTML alternative). Arrayref of lines, or scalar.
- Will be placed inside an HTML <BODY> tag.
- Email body (Text alternative). Arrayref of lines, or scalar.
- custnum, msgnum (optional)
- Customer and template numbers, passed through to send_email for logging.
- Constructs a multipart message from text_body and html_body.
- send_fax OPTION => VALUE ...
- dialstring - (required) 10-digit phone number w/ area code
- docdata - (required) Array ref containing PostScript or TIFF Class F document
- 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.
- cities COUNTY STATE COUNTRY
- Returns a list of cities for this county, 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).
- Returns a hash reference of allowed package billing frequencies.
- 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.
- do_print ARRAYREF [, OPTION => VALUE ... ]
- Sends the lines in ARRAYREF to the printer.
- Options available are:
- Uses this agent's 'lpr' configuration setting override instead of the global value.
- Uses this command instead of the configured lpr command (overrides both the global value and agentnum).
- 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.
- ocr_image IMAGE_SCALAR
- Runs OCR on the provided image data and returns a list of text lines.
- bytes_substr STRING, OFFSET[, LENGTH[, REPLACEMENT] ]
- A replacement for "substr" that counts raw bytes rather than logical characters. Unlike "bytes::substr", will suppress fragmented UTF-8 characters rather than output them. Unlike real "substr", is not an lvalue.
- Accepts a postive or negative numerical value. Returns amount formatted for display, including money character.
This package exists.
Hey! The above document had some coding errors, which are explained below:
- Around line 977:
- You forgot a '=back' before '=head1'