Difference between revisions of "Freeside:3:Documentation:Developer/FS/cust msg"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
 
m (Edit via perl MediaWiki framework (1.13))
 
Line 14: Line 14:
 
</code>
 
</code>
 
==DESCRIPTION==
 
==DESCRIPTION==
An FS::cust_msg object represents a template-generated message sent to a customer (see [[Freeside:3:Documentation:Developer/FS/msg template|FS::msg_template]]). FS::cust_msg inherits from FS::Record. The following fields are currently supported:
+
An FS::cust_msg object represents an email message generated by Freeside and sent to a customer (see [[Freeside:3:Documentation:Developer/FS/msg template|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; _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&#58;&#58;Sender error message (or null for success)
+
; 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&#58;&#58;Sender error message (or null for success)
 
==METHODS==
 
==METHODS==
 
; new HASHREF
 
; new HASHREF
Line 28: Line 28:
 
; check
 
; 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.
 
: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 [[Freeside:3:Documentation:Developer/MIME/Entity|MIME::Entity]].
 +
; parts
 +
:Returns a list of the MIME parts contained in the message, as [[Freeside:3:Documentation:Developer/MIME/Entity|MIME::Entity]] objects.
  
 
==SEE ALSO==
 
==SEE ALSO==
 
[[Freeside:3:Documentation:Developer/FS/msg template|FS::msg_template]], [[Freeside:3:Documentation:Developer/FS/cust main|FS::cust_main]], [[Freeside:3:Documentation:Developer/FS/Record|FS::Record]].
 
[[Freeside:3:Documentation:Developer/FS/msg template|FS::msg_template]], [[Freeside:3:Documentation:Developer/FS/cust main|FS::cust_main]], [[Freeside:3:Documentation:Developer/FS/Record|FS::Record]].

Latest revision as of 14:33, 27 June 2014

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.