I use a shopping cart application that automatically generates and sends e-mail messages to confirm purchases as well as issue authorization codes for purchased downloads, however lately I've been getting so many code 550 (returned as possible spam) messages from my customer's e-mail servers that this process is no longer automatic or viable.
What I am trying to do is simply make the very same data that is e-mailed to become also available to the customer via their browser. This is necessary as a fail-safe for the communication process: to both preserve the automation and to eliminate any delays as well as the manual intervention now necessary to insure that most communication is even received by my customers!
My idea was perhaps doing so by creating a PHP output buffer content of this customer e-mail data to be stored from the current output line and then implementing a call from the PHP output buffer of this same data into a simple PHP "template" page such to generate a dynamic post-payment confirmation "thank you" page.
This page could then be delivered immediately to the browser... containing all of the user data (mirrored from the generated e-mail)... to replace my current static post-payment confirmation "thank you" page.
In summary: I'm trying to take some generated data that has been outputted via PHP to e-mail... save this into a PHP output buffer... then recall this same data into a webpage (template) for display into a browser such that my customer receives both an e-mail of the data (this already occurs) in addition to displaying this same data to their browser (this needs to occur).
Does this make sense? Is it possible? Does anyone know how to PHP code something like this?
Is seems that I would have to modify the current page containing the e-mail output statement with a buffer command to contain the data, then create a page to recall and display the buffered output data.
Is this pure folly, or a practical, easily code-able solution?
I'm even willing to compensate via PayPal someone who can implement this action via coding!
Thanks so much for your attention and any clues or assistance.
-Rich-
Posting e-mailed data also to browser using Output Buffering
Moderator: General Moderators
-
CluelessAndSad
- Forum Newbie
- Posts: 2
- Joined: Tue Jan 11, 2011 4:31 pm
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Posting e-mailed data also to browser using Output Buffe
Possible and probably fairly easy. Most e-commerce solutions usually show this information on a confirmation page in addition to emailing it.CluelessAndSad wrote:Does this make sense? Is it possible? Does anyone know how to PHP code something like this?
It could be as easy as changing the carriage returns in the email to HTML line breaks and then echoing the text. Something like this:
Code: Select all
// assumes that the email body is in a variable $email somewhere (the var name may be different)
echo str_replace("\r", "<br/>\r", $email);(#10850)
-
CluelessAndSad
- Forum Newbie
- Posts: 2
- Joined: Tue Jan 11, 2011 4:31 pm
Re: Posting e-mailed data also to browser using Output Buffe
Christopher,
Thanks so much for the speedy reply and tip.
I'll definitely try something along that line when time permits and surely
let you know the result.
I'm not much of a programmer... actually just a musician with a webpage...
one that can only learn enough PHP to be dangerous: hopefully in a good way...
Given what little I do know (actually should say, have been forced to learn)
my thought seemed to be a rather trivial, doable and perhaps even somewhat of
an easy solution to the problem. I just wasn't sure exactly how to code it.
Enter the PHP "grownups", like you...
Unfortunately I've literally begged the app developer for assistance and he has not
seen fit to lend any assistance whatsoever. Complicating matters is that I have been
using this app for several years and have hundreds of products, etc. successfully setup.
Sadly and frustratingly, given the nature of my problem it seems more practical for me
to crash course PHP rather than move everything to a different solution at this point.
Anyway, I do surely appreciate your attention, expertise and kindness.
It is apparent that you are both a scholar and a gentleman!
Enjoy your night and best success in all of your endeavors.
-Rich-
Thanks so much for the speedy reply and tip.
I'll definitely try something along that line when time permits and surely
let you know the result.
I'm not much of a programmer... actually just a musician with a webpage...
one that can only learn enough PHP to be dangerous: hopefully in a good way...
Given what little I do know (actually should say, have been forced to learn)
my thought seemed to be a rather trivial, doable and perhaps even somewhat of
an easy solution to the problem. I just wasn't sure exactly how to code it.
Enter the PHP "grownups", like you...
Unfortunately I've literally begged the app developer for assistance and he has not
seen fit to lend any assistance whatsoever. Complicating matters is that I have been
using this app for several years and have hundreds of products, etc. successfully setup.
Sadly and frustratingly, given the nature of my problem it seems more practical for me
to crash course PHP rather than move everything to a different solution at this point.
Anyway, I do surely appreciate your attention, expertise and kindness.
It is apparent that you are both a scholar and a gentleman!
Enjoy your night and best success in all of your endeavors.
-Rich-