SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    Port Harcourt
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A system that dynamically create pdf, attach it and send to all people in the Db.

    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.

  2. #2
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suggest you to use wk2html for PDF creation. It can html + javascript.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    Port Harcourt
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    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?
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    Port Harcourt
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  6. #6
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    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,
    Create PDF
    Email PDF
    Next customer.

    Perhaps you can indicate which part of this you are having trouble with.
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  7. #7
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    Port Harcourt
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,870
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    I'd work it:

    Select recipient
    Create their PDF
    Attach PDF to email and send
    delete PDF
    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.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  9. #9
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    Port Harcourt
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •