Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2012
    Location
    Utrecht, Nederland
    Posts
    41
    Plugin Contributions
    0

    help question Static pdf attachments to confirmation mail.

    New regulations states in my country i should mail 2 files to my costumers, 1 with conditions and 1 form how to return the product. Anyway i'd like to send those two pdf's along with te confirmation mail, not an extra mail. I looked in the faq area, but dit not find this problem.
    I did see in functions_email.php a section about $attachments_list but i'm nog shure thats it. And i cant find where to enable it. I did find some threads about attachments and emails, but they where ancient and asked for much more difficult files to be sent.
    These 2 pdf's i want to send are also on the server, people can download them form the site. Can someone point me to the right direction?
    thanks in advance :-)

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Static pdf attachments to confirmation mail.

    Try this:

    1. copy your 2 pdf files into the /download folder
    2. add 2 new files to your server, as shown below:

    a) /includes/classes/observers/class.zcObserverAttachTermsConditionsToOrderConfirmation.php
    Code:
    <?php/**
     * @package plugins
     * @copyright Copyright 2003-2014 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version GIT: $Id: Author: DrByte Jul 08 2014 $
     *
     * Designed for v1.5.1 thru 1.6.0
     */
    
    
    class zcObserverAttachTermsConditionsToOrderConfirmation extends base {
    
    
      function __construct() {
        $this->attach($this, array('NOTIFY_ORDER_INVOICE_CONTENT_READY_TO_SEND'));
      }
    
    
      function update(&$callingClass, $eventID)
      {
        $callingClass->attachArray = array(
          array('file' => DIR_FS_CATALOG . 'download/returns.pdf', // you can put the actual server filename here 
                'name' => 'ReturnInstructions.pdf',    // this is the name you want the attachment file have in the email (can be the same as above if desired)
                'mime-type' => 'application/pdf',
               ),
          array('file' => DIR_FS_CATALOG . 'download/tos.pdf',  // put actual server filename here
                'name' => 'TermsOfService.pdf',    // put friendly name here
                'mime-type' => 'application/pdf',
               ),
        );
      }
    }
    b) /includes/auto_loaders/config.zcObserverAttachTermsConditionsToOrderConfirmation.php
    Code:
    <?php
    /**
     *
     * @package plugins
     * @copyright Copyright 2003-2014 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version GIT: $Id: Author: DrByte Jul 08 2014 $
     */
    /**
     * Designed for v1.5.1 thru 1.6.0
     */
    if (!defined('IS_ADMIN_FLAG')) {
     die('Illegal Access');
    }
    $autoLoadConfig[200][] = array('autoType'=>'class',
                                  'loadFile'=>'observers/class.zcObserverAttachTermsConditionsToOrderConfirmation.php');
    $autoLoadConfig[200][] = array('autoType'=>'classInstantiate',
                                  'className'=>'zcObserverAttachTermsConditionsToOrderConfirmation',
                                  'objectName'=>'zcObserverAttachTermsConditionsToOrderConfirmation');
    .

    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.

  3. #3
    Join Date
    Nov 2012
    Location
    Utrecht, Nederland
    Posts
    41
    Plugin Contributions
    0

    Default Re: Static pdf attachments to confirmation mail.

    Dr.Drybite, I really forgot to thank you!! I found out after all these monts. But i got it working thanks to you.

 

 

Similar Threads

  1. v151 PDF Attachments
    By ttmb33 in forum Customization from the Admin
    Replies: 3
    Last Post: 6 Dec 2013, 03:59 PM
  2. v139h Order Confirmation - PDF Attachment
    By tcl01 in forum General Questions
    Replies: 4
    Last Post: 13 Sep 2012, 09:29 PM
  3. Mail the PDF Invoice
    By Vandana in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 29 Sep 2009, 12:03 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR