code/pagetypes/MetadataPostcardEntryPage.php
/**
     * Emails a single curator that there has been a new entry in a catalogue.
     * @param String $name          Name of the curator, used in the email.
     * @param String $emailAddress  Email address to send the message to.
     * @param String $subject       The subject of the email.
     * @param String $body          The body of the emal.
     * @param String $newRecordLink URL ID of the newly created record in the Catalogue.
     * @param String $additionalMessageEmail Email entered on the form of who the message is from.
     * @param String $additionalMessageText Message entered by the user on the form.
     */
Emails a single curator that there has been a new entry in a catalogue.
@param String $name          Name of the curator, used in the email.
@param String $emailAddress  Email address to send the message to.
@param String $subject       The subject of the email.
@param String $body          The body of the emal.
@param String $newRecordLink URL ID of the newly created record in the Catalogue.
@param String $additionalMessageEmail Email entered on the form of who the message is from.
@param String $additionalMessageText Message entered by the user on the form.
Emails a single curator that there has been a new entry in a catalogue . @param String $name Name of the curator used in the email . @param String $emailAddress Email address to send the message to . @param String $subject The subject of the email . @param String $body The body of the emal . @param String $newRecordLink URL ID of the newly created record in the Catalogue . @param String $additionalMessageEmail Email entered on the form of who the message is from . @param String $additionalMessageText Message entered by the user on the form .
protected function EmailCurator($name, $emailAddress, $subject, $body, $newRecordLink, $additionalMessageEmail, $additionalMessageText)
    {
        if ($name && $emailAddress && $subject && $body && $newRecordLink) {
            $body = str_replace(array('{NAME}', '{LINK}'), array($name, $newRecordLink), $body);
            if ($additionalMessageEmail || $additionalMessageText) {
                $subject .= " PLUS message from " . $additionalMessageEmail;
                $body .= "\n\n----------------------------------------------------\n" .
                         "Message from " . $additionalMessageEmail . "...\n\n" .
                         $additionalMessageText;
            }
            $email = new Email(
                $this->FromEmailAddress,
                $emailAddress,
                $subject,
                $body
            );
            $email->sendPlain();
        }
    }
protected function EmailCurator ( $ name , $ emailAddress , $ subject , $ body , $ newRecordLink , $ additionalMessageEmail , $ additionalMessageText ) { if ( $ name && $ emailAddress && $ subject && $ body && $ newRecordLink ) { $ body = str_replace ( array ( '{NAME}' , '{LINK}' ) , array ( $ name , $ newRecordLink ) , $ body ) ; if ( $ additionalMessageEmail || $ additionalMessageText ) { $ subject .= "  PLUS message from  " . $ additionalMessageEmail ; $ body .= " \n \n ---------------------------------------------------- \n " . " Message from  " . $ additionalMessageEmail . " ... \n \n " . $ additionalMessageText ; } $ email = new Email ( $ this -> FromEmailAddress , $ emailAddress , $ subject , $ body ) ; $ email -> sendPlain ( ) ; } }
Emails a single curator that there has been a new entry in a catalogue.
Emails a single curator that there has been a new entry in a catalogue .
// Check for special variables of {NAME} and {LINK} in the body and replace with // the name of the curator and the postcardID link. // If the user wants to include an additional message to the curator then add this in after the main body. // Alter the subject to include plus message from {email} // Add the email and message to the body. // Just send plain email, no need for a fancy template.