[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

CAKEPHP: Simple Contact Form within Controller

Posted on 2009-07-10
5
Medium Priority
?
650 Views
Last Modified: 2013-12-13
This URL:

.../consumers/unsubscribe/id:123

is embedded in an email, and allows for a user to opt out of future emails. On this same page, the "unsubscribe" view, I have a simple form with a textarea and a submit button, and I would like to allow the user to submit feedback as to why they are unsubscribing.

But I am not storing the data anywhere. Just emailing it. So how would I do this?

Thank you.
0
Comment
Question by:edvinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
DolGuldur earned 2000 total points
ID: 24879531
Hi,

Add the Email component to your consumers controller. In your unsubscribe action, add something similar to this after record deletion:

if ($this->Model->del($id)) {
$this->Email->from    = 'Somebody <somebody@example.com>';
$this->Email->to      = 'Somebody Else <somebody.else@example.com>';
$this->Email->subject = 'Test';
$this->Email->send($this->data[modelName][textareaName]);
}

Change the variables to reflect what you want and there you will receive an email when someone unsubscribe.
0
 
LVL 5

Expert Comment

by:DolGuldur
ID: 24879553
Additional information on how to send simple message using the Email component in CakePHP

http://book.cakephp.org/view/269/Sending-a-basic-message
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question