Friday, October 16, 2009

Re: Email

I would store the form data in session variables - you do not have to
write to the database then you could pass them to the email function.
Have a look at the book to get you started.

On Oct 15, 6:47 pm, Simon <simon_d...@hotmail.com> wrote:
> yep you understood me thats i would like to try but i dont want to
> restore the emails into database
> is there anyway to do that
>
> On Oct 15, 10:32 am, number9 <xpozit...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > I'm not sure if I have understood you correctly, but you want to share
> > a post with somebody, and when you go to /posts/sharethis/22 it wont
> > let you fill in the form first?
>
> > Looking at your code, the E-mail will always send first because it
> > appears before the code for the form. If you wanted to use the same
> > action to retrieve the form details and then send the data you would
> > need to use conditional statements (E.g. if the form isn't empty -
> > send the E-mail).
>
> > I would have one action to retrieve the details from the form and
> > store them, then redirect to the sharethis action which sends out the
> > E-mail from the variables given in the form.
>
> > Sorry if I have misunderstood what you was trying to acheive.
>
> > On Oct 15, 3:56 pm, Simon <simon_d...@hotmail.com> wrote:
>
> > > hi i'm creating mailto with cakephp email components to share the post
> > > how do i do this with the form the have to fill out
>
> > > form:
> > > to:
> > > comment:
>
> > > then submit send that post id and the content of post  this is i did
> > > so far  when i go to posts/sharethis/22 it sends email but wont let me
> > > fill the form first
>
> > > function sharethis($id) {
> > >     $this->layout = null;
> > >     $Post = $this->Post->read(null,$id);
> > >     $this->Email->to =  $this->data['Post']['to'],;
> > >     $this->Email->bcc = array('sec...@example.com');
> > >     $this->Email->subject = 'Welcome to our really cool thing';
> > >     $this->Email->replyTo = 'supp...@example.com';
> > >     $this->Email->from = $this->data['Post']['from'],;
> > >     $this->Email->template = 'Post'; // note no '.ctp'
> > >     //Send as 'html', 'text' or 'both' (default is 'text')
> > >     $this->Email->sendAs = 'html';
>
> > >      $this->set('post', $this->Post->read(null, $id));
>
> > >  if ( $this->Email->send() ) {
>
> > >                     $this->redirect('/thankyou');
> > >                         } else {
> > >                                 $this->Session->setFlash(__('this could not be saved. Please, try
> > > again.', true));
> > >                         }
> > >  }
>
> > > <?php
> > >                 echo $form->create('post', array('action' =>
> > > 'sharethis'));
> > >                 echo $form->inputs(array('legend' => false,
> > >                                          'fieldset' => false,
> > >                                          'from',
> > >                                          'to',
> > >                                          'comments' => array('row' =>
> > > 10,
> > >                                                              'cols' =>
> > > 45,
> > >                                                              ),
> > >                                          ));
>
> > >                                 echo $form->submit('/img/submit.gif', array('alt' =>
> > > 'Submit','class' => 'image'));
> > >                                 echo $form->end();
> > >             ?>- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate