Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Create custom mass-email script

    I have a requirement to send out a custom email to customers, but it needs to be automated as it is going out to 15000 + clients.
    I have written the sql query that collates all the customer details from the 400k rows of data we have for them, but i can't figure out how to hook it into the existing email system. I don't want to use the email page from admin, but create an entirely new option where admin can select number of days dormant to vary who this email is going to.

    I know that email processing from orders etc is handled by includes/functions/functions_email.php and that the email template is selected based on $current_page_base but i'm unsure on how i get my admin file dormant_mail.php to connect to and trigger the email process.

    Can anyone tell me the current process for handling a checkout confirmation email for instance as the email content is built in orders.php and then passed on, yet function_email knows current_page_base was checkout_confirmation.

    So, if my "email variables" are collected in admin/dormant_mail.php, do they need to be passed elsewhere to build the content, and then passed onto includes/functions/functions_email.php??

    Writing the required code isn't an issue as i'm proficient with php, java and mysql, but i just don't get the zc way of preparing and handling emails.

    Any help at all greatly appreciated.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Create custom email function

    but it needs to be automated as it is going out to 15000 + clients.
    With that many clients, you should be using a email service
    Most hosts impose a limit on how many emails can be sent and this is considered advertisement and should be treated as such
    Mail Chimp is one that can be integrated into Zencart
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Re: Create custom email function

    Try telling that to the large corporate client that the site is owned by!
    Besides, it really isn't a simple option of using a mail client as the emails need to contain information held within a second database that it's connected to and that needs to be updated as each email is sent.
    Clients receiving this email have already agreed to receive marketing emails by the way, they are not unsolicited.
    Last edited by strelitzia; 8 Mar 2013 at 03:44 PM.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Create custom email function

    Try telling that to the large corporate client that the site is owned by!
    If it is on their own server then disregard my post - of not then My post stands

    As a responsible individual, it is up to you to consul your clients as to the correct way to proceed
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Nov 2005
    Location
    France
    Posts
    600
    Plugin Contributions
    8

    Default Re: Create custom email function

    Quote Originally Posted by kobra View Post
    If it is on their own server
    It is on their own server

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Create custom email function

    Might post the contents of your custom dormant_mail.php file
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Create custom mass-email script

    Quote Originally Posted by strelitzia View Post
    I have a requirement to send out a custom email to customers, but it needs to be automated as it is going out to 15000 + clients.
    I have written the sql query that collates all the customer details from the 400k rows of data we have for them, but i can't figure out how to hook it into the existing email system. I don't want to use the email page from admin, but create an entirely new option where admin can select number of days dormant to vary who this email is going to.

    I know that email processing from orders etc is handled by includes/functions/functions_email.php and that the email template is selected based on $current_page_base but i'm unsure on how i get my admin file dormant_mail.php to connect to and trigger the email process.

    Can anyone tell me the current process for handling a checkout confirmation email for instance as the email content is built in orders.php and then passed on, yet function_email knows current_page_base was checkout_confirmation.

    So, if my "email variables" are collected in admin/dormant_mail.php, do they need to be passed elsewhere to build the content, and then passed onto includes/functions/functions_email.php??

    Writing the required code isn't an issue as i'm proficient with php, java and mysql, but i just don't get the zc way of preparing and handling emails.

    Any help at all greatly appreciated.
    I'm not sure I really understand what you're asking.
    If you're sending emails from your admin, why are you making reference to checkout_confirmation which is a non-admin activity? Same with $current_page_base.

    Sending emails is as simple as making a call to zen_mail() and passing the necessary parameters. You can find tons of examples of this already in the core code. The only "tip" you might not see so obviously in the examples is that the $module parameter can be set to whatever you want it to be, ideally to match a custom HTML email template file you've created by the same pattern. Again, if it's not clear by looking at the examples, if you pass 'dormant' as your $module parameter, then it will look for the /email/email_template_dormant.html file when processing variables for the HTML email it's generating. Also remember that text-only emails don't use the HTML template; they're just assembled by you directly in the code and passed as a string to zen_mail, unlike the $html_msg array of keys you build in the code to pass to zen_mail().
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v151 How to make a custom HTML create account confirmation email
    By abdulpatesh in forum General Questions
    Replies: 1
    Last Post: 1 Dec 2015, 07:06 PM
  2. Create Custom Page with Email Form
    By bparker in forum General Questions
    Replies: 2
    Last Post: 17 Jan 2014, 05:54 PM
  3. Unsuscribe email link in custom script
    By solo_400 in forum General Questions
    Replies: 2
    Last Post: 29 Jun 2013, 01:26 PM
  4. How to Create an additional Custom Email?
    By Decostyle in forum General Questions
    Replies: 30
    Last Post: 9 Oct 2009, 01:08 PM
  5. custom Add Customer email (need custom welcome email)
    By rennsix in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 8 Dec 2007, 08:06 AM

Posting Permissions

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