Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8043775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:01:00+00:00 2026-06-05T05:01:00+00:00

I’m building a small, local app for a lab I work in. Long story

  • 0

I’m building a small, local app for a lab I work in. Long story short, I’ve written a class (call it MailParser) that can log-in to a shared Gmail account and retrieve/parse e-mails that always arrive in a standardized format. The class works great. I want the interface for it to be built in Cake. I don’t know how to bring the two together appropriately, and I’m pretty confident that what I’m doing, while functional, could be much improved.

The e-mails are automated responses from a registry our university hosts; they inform researchers of students who’ve signed up to be in experiments.

The Cake site will basically be a UI that allows lab members to manage a database. The MailParser class needs the database; it compares information parsed out of those e-mails against information in the database to subsequently update a variety of Google Calendars (say an e-mail reads “Participant_X has signed up for Experiment_Y”; the database will know that “Experiment_Y” is being run by “Experimenter_Z” and post it to their calendar for them).

The Cake app is small and simple; “Experiments”, “Experimenters”, “Calendars”.

I’ve done this:

<?php 

App:users('AppController', 'Controller');
/**
 * Personas Controller
 *
 * @property Persona $Persona
 */
class MailparsersController extends AppController {
    function index($getMail=false) {
    //bunch o' code
    }

 //bunch o' functions
}
?>

The file name is MailparsersController.php. There’s no model or view for, but I don’t want there to be; ultimately, this class wil get called from a small Python app that I’d like to periodically make an http request to mylabserver.com/Mailparsers (could use javascript, just don’t want to leave a browser open all the time). My index() function, when called, does everything it should, but returns an error page. Is there a way to let a Cakephp controller quietly do its work without returning a view at all?

The cake-based UI lets lab members ‘register’ their experiments and their correspondent calendars, thereby automating part of the workflow; I could just write this php myself, given its limited use, but I’m a big Cakephp fan and am always looking for ways to extend its usefulness to my purposes.

Can anyone suggest an appropriate way to bring my Mailparser functionality into my Cake app? Would this be more appropriate as a plug-in (which I’ve never done before)? I’d be super grateful for any help, here. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:01:01+00:00Added an answer on June 5, 2026 at 5:01 am

    Since you’re in cake 2.x, I’m going to suggest this:

    1. Store your class in the Lib folder
    2. Create a new component, e.g. MailparserComponent, where you can load your class with something like this: App::uses('Mailparser', 'Lib');
    3. Create a clean “cakeish” API with your component methods, and keep your class hidden from the rest of the app.

    Alternatively, you can change your class into a component. Either way, you can use your class in any controller in your app without any issues.

    Furthermore, if you’re really planning to use this code in other apps in the future, a plugin is the way to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.