[thelist] Help Finding an HTML Email View in a CakePHP Application
Jon Molesa
rjmolesa at consoltec.net
Wed Jul 1 10:45:05 CDT 2009
Try:
app/views/elements/email/html
app/views/elements/email/txt
app/views/emailxs/html
app/views/emailxs/txt
*On Wed, Jul 01, 2009 at 11:29:21AM -0400 Randal Rust <randalrust at gmail.com> wrote:
> Date: Wed, 1 Jul 2009 11:29:21 -0400
> From: Randal Rust <randalrust at gmail.com>
> Subject: [thelist] Help Finding an HTML Email View in a CakePHP Application
> To: thelist at lists.evolt.org
>
> We have inherited a CakePHP application that sends a formatted HTML
> email when someone completes the site's registration process. The
> method that invokes the email is:
>
> $this->Invoice->send($districtInfo['District']['invoiceEmail'], 'PO
> Order', $insert_data)
>
> The problem I'm having is that I cannot find the view for the HTML
> formatting. If I look at the Invoice model, I cannot figure out where
> the code (see below) calls the view. This does not seem to follow
> anything that I see here:
>
> http://book.cakephp.org/view/269/Sending-a-basic-message
>
> ============================================
>
> function send($email, $invoice_id, $insert_data)
> {
> if (! preg_match(VALID_EMAIL, $email)) {
> return false;
> }
> if (preg_match('/^[0-9]{1,10}$/', $invoice_id)) {
> $result = $this->find(('`Invoice`.`id` = ' . $invoice_id));
> } else {
> $result = $this->find(('`Invoice`.`name` = "' .
> $this->mrClean->sql($invoice_id) . '"'));
> }
> if (empty($result)) {
> return false;
> }
>
> $tokens = array();
> $replacements = array();
> foreach ($insert_data as $key => $value) {
> $tokens[] = '%' . $key . '%';
> $replacements[] = $value;
> }
> $message = str_replace($tokens, $replacements, $result['Invoice']['invoice']);
> $headers = 'MIME-Version: 1.0' . "\r\n" .
> 'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
> 'From: ' . $this->adminEmail . "\r\n" .
> 'Reply-To: ' . $this->adminEmail . "\r\n" .
> 'Bcc: ' . 'test at example.com' . "\r\n" .
> 'X-Mailer: PHP/' . phpversion();
> if (mail($email, $result['Invoice']['name'], $message, $headers,
> ('-f' . $this->adminEmail)) &&
> mail($this->adminEmail, $result['Invoice']['name'], $message,
> $headers, ('-f' . $this->adminEmail))) {
> return true;
> } else {
> return false;
> }
> }
>
> --
> Randal Rust
> R.Squared Communications
> www.r2communications.com
> 614-370-0036
> --
>
> * * Please support the community that supports you. * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
--
Jon Molesa
rjmolesa at consoltec.net
if you're bored or curious
http://rjmolesa.com
More information about the thelist
mailing list