papadammy — 2012-12-11T10:34:28-05:00 — #1
Good day all programmers in the house. I'm working on a project that involves creation of pdf dynamically, attach each created pdf to the corresponding email address in the database and then send the email and the attachment on a preset day. In a nut shell, I want to create a system that functions like what bank uses to send pdf document of each of their customers' account details at the month end to each customer.
I can create pdfs one at a time using fdpf. What I want is at the click of a button in my web application, all pdf for each member that will be using the application will be created and attached to the corresponding email address and sent to the right person on a preset day. Please how do I get this achieved? thanks in advance.
belekevicius — 2012-12-12T15:20:58-05:00 — #2
papadammy — 2012-12-14T05:06:16-05:00 — #3
Thanks belekevicius. I actually like fpdf and it works great. I just want to know how to do the task I asked about up there. If you have an idea, tha'll be great. Thanks for sharing.
starlion — 2012-12-16T23:35:00-05:00 — #4
Well, for starters, I wouldn't do this.
How big are the PDF's? Have you asked your users if it's ok to send potentially mailbox-jamming amounts of PDF to them?
Will your SMTP server allow you to send that many emails in a single day?
papadammy — 2012-12-18T08:19:28-05:00 — #5
Thanks StarLion. The pdfs are not big at all. I'm planning to host on VPS so that there will be no restrictions. Any advice?
starlion — 2012-12-18T21:05:35-05:00 — #6
Assuming that's not an issue (which.. I'm still thinking it will be, but whatever), break down your steps.
Get list of customers.
For each customer,
Perhaps you can indicate which part of this you are having trouble with.
papadammy — 2012-12-23T16:51:21-05:00 — #7
Thanks StarLion and I'm really sorry for responding late. I actually have an issue with what the steps should be. I am thinking of generating all the pdfs first at a click of button in a directory and on clicking another button meant to send the emails, the script that runs will locate each generated pdfs and attach to the coressponding emails correctly and send to the customers. Is that a better way or there is another better way to doing this? Thanks in advance man.
felgall — 2012-12-23T18:02:57-05:00 — #8
I'd work it:
Create their PDF
Attach PDF to email and send
repeat for next recipient
that way you only need to have the one PDF that you are about to send taking up space on the server.
papadammy — 2012-12-24T13:07:56-05:00 — #9
Thanks Felgall, foreach should be able to get me through it, I think? I will write the code and test to see how it goes. Thanks a lot.