'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 19 September 2005 at 8:48:33 am'! ListRootPersistent subclass: #RSVPEntry instanceVariableNames: 'name numberAttending location emailAddress comment' classVariableNames: '' poolDictionaries: '' category: 'Guestbook'! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 7/12/2005 09:55'! comment ^comment ifNil: [comment := '']! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 6/21/2005 10:38'! comment: anObject comment := anObject! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 6/21/2005 10:37'! emailAddress ^emailAddress! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 6/21/2005 10:37'! emailAddress: anObject emailAddress := anObject! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 7/13/2005 13:05'! location ^location ifNil: [location := '']! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 6/21/2005 10:37'! location: anObject location := anObject! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 6/21/2005 10:37'! name ^name! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 6/21/2005 10:37'! name: anObject name := anObject! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 7/13/2005 13:04'! numberAttending ^numberAttending ifNil: [numberAttending := '']! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 6/21/2005 10:37'! numberAttending: anObject numberAttending := anObject! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 7/13/2005 13:04'! phoneNumber ^phoneNumber ifNil: [phoneNumber := '']! ! !RSVPEntry methodsFor: 'accessing' stamp: 'cds 6/21/2005 10:37'! phoneNumber: anObject phoneNumber := anObject! ! !RSVPEntry methodsFor: 'validating' stamp: 'cds 6/21/2005 10:58'! isComplete ^name notNil and: [name notEmpty and: [emailAddress notNil and: [emailAddress notEmpty]]]! ! !RSVPEntry methodsFor: 'email notification' stamp: 'cds 8/12/2005 12:55'! mailNotificationTo: to | from mailMsg | (self emailAddress isNil or: [self emailAddress isEmpty]) ifTrue: [self error: 'The email address must be specified']. from := self emailAddress. mailMsg := self notificationMessageFrom: from to: to. SMTPClient deliverMailFrom: mailMsg from to: (Array with: mailMsg to) text: mailMsg text usingServer: MailSender smtpServer! ! !RSVPEntry methodsFor: 'email notification' stamp: 'cds 6/21/2005 11:11'! notificationMessageFrom: from to: to | mailMsg | mailMsg _ MailMessage empty. mailMsg setField: 'from' toString: from. mailMsg setField: 'to' toString: to. mailMsg setField: 'subject' toString: 'RSVP from ' , self name. mailMsg setField: 'date' toString: TimeStamp current printHttpFormat. mailMsg body: (MIMEDocument contentType: 'text/plain' content: self notificationText). ^ mailMsg! ! !RSVPEntry methodsFor: 'email notification' stamp: 'cds 6/21/2005 11:04'! notificationText ^'An RSVP has been sent: Name: ' , self name , ' Number attending: ' , self numberAttending printString , ' Email: ' , self emailAddress , ' Where staying: ' , self location ,' Comment: ' , self comment,' '! ! !RSVPEntry methodsFor: 'printing' stamp: 'cds 6/25/2005 21:18'! printOn: aStream aStream nextPutAll: self name! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! RSVPEntry class instanceVariableNames: ''! !RSVPEntry class methodsFor: 'database' stamp: 'cds 6/21/2005 10:21'! listName ^'list.RSVPEntries'! !