Freeside:3:Documentation:Developer/FS/cust msg

From Freeside
Jump to: navigation, search

NAME

FS::cust_msg - Object methods for cust_msg records

SYNOPSIS

 use FS::cust_msg;

 $record = new FS::cust_msg \%hash;
 $record = new FS::cust_msg { 'column' => 'value' };

 $error = $record->insert;

 $error = $record->check;

DESCRIPTION

An FS::cust_msg object represents an email message generated by Freeside and sent to a customer (see FS::msg_template). FS::cust_msg inherits from FS::Record. The following fields are currently supported:

custmsgnum - primary key; custnum - customer number; msgnum - template number; msgtype - the message type; _date - the time the message was sent; env_from - envelope From address; env_to - envelope To addresses, including Bcc, separated by newlines; header - message header; body - message body; error - Email::Sender error message (or null for success)

METHODS

new HASHREF
Creates a new
insert
Adds this record to the database. If there is an error, returns the error and emits a warning; otherwise returns false.
delete
Delete this record from the database. There's no reason to do this.
replace OLD_RECORD
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error and emits a warning, otherwise returns false.
check
Checks all fields to make sure this is a valid example. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
entity
Returns the complete message as a MIME::Entity.
parts
Returns a list of the MIME parts contained in the message, as MIME::Entity objects.

SEE ALSO

FS::msg_template, FS::cust_main, FS::Record.