4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs dbdef );
6 use FS::UID qw( dbh driver_name );
10 FS::log_email - Object methods for log email records
16 $record = new FS::log_email \%hash;
17 $record = new FS::log_email { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::log object represents the conditions for sending an email
30 when a log entry is created. FS::log inherits from FS::Record.
31 The following fields are currently supported:
35 =item logemailnum - primary key
37 =item context - the context that will trigger the email (all contexts if unspecified)
39 =item min_level - the minimum log level that will trigger the email (all levels if unspecified)
41 =item msgnum - the msg_template that will be used to send the email
43 =item to_addr - who the email will be sent to (in addition to any bcc on the template)
53 Creates a new log_email entry.
57 sub table { 'log_email'; }
61 Adds this record to the database. If there is an error, returns the error,
62 otherwise returns false.
66 Delete this record from the database.
68 =item replace OLD_RECORD
70 Replaces the OLD_RECORD with this one in the database. If there is an error,
71 returns the error, otherwise returns false.
75 Checks all fields to make sure this is a valid record. If there is
76 an error, returns the error, otherwise returns false. Called by the insert
85 $self->ut_numbern('logemailnum')
86 || $self->ut_textn('context') # not validating against list of contexts in log_context,
87 # because not even log_context check currently does so
88 || $self->ut_number('min_level')
89 || $self->ut_foreign_key('msgnum', 'msg_template', 'msgnum')
90 || $self->ut_textn('to_addr')
92 return $error if $error;
103 L<FS::Record>, schema.html from the base documentation.