Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Send customer a link on checkout

    This should work for v1.5.5 through 1.5.7:

    Save it to your server as /includes/classes/observers/auto.send_ebook_download_link_in_email.php
    Code:
    <?php
    /**
     * Send product download URL in order confirmation email
     * CAVEAT: This will send the link regardless of payment status, so only use it if your payment modules require complete payment.
     * NOTE: The link that's sent takes the customer into their account, so if they're not logged in when they click the link in the email, it will ask them to login.
     *
     * This observer class is designed for Zen Cart v1.5.5 or newer.
     */
    
    class zcObserverSendEbookDownloadLinkInEmail extends base
    {
        public function __construct()
        {
            $this->attach($this, [
                'NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_DOWNLOAD_LINE_ITEM',
            ]);
        }
    
        public function updateNotifyOrderDuringCreateAddedAttributeDownloadLineItem(&$orderClass, $eventID, $download_data, $orders_products_download_id)
        {
            $orderClass->products_ordered_attributes .= "\n";
            $orderClass->products_ordered_attributes .= '<a href="' . zen_href_link(FILENAME_DOWNLOAD, 'order=' . $download_data['orders_id'] . '&id=' . $orders_products_download_id) . '">';
            $orderClass->products_ordered_attributes .= $download_data['orders_products_filename'] . ' ';
            $orderClass->products_ordered_attributes .= '</a>';
        }
    }
    .

    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.

  2. #12
    Join Date
    Jan 2010
    Location
    Richmond, Virginia, United States
    Posts
    114
    Plugin Contributions
    0

    Default Re: Send customer a link on checkout

    I just got a chance to try this. I'm not sure if it's supposed to generate a second email or not, but nothing happens. The order confirmation email goes out (without a link) and that's the only email the customer receives.

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

    Default Re: Send customer a link on checkout

    I just tested it on a v1.5.7a site, so I know it works. I believe I'd initially tested it before I posted it, too.

    No extra emails sent. Just the regular order-confirmation email to the customer, and to the admin if enabled.

    It adds the link directly in the order-confirmation email, where it lists the product attributes (downloads) purchased.

    As written, the link only shows for HTML emails.
    I guess if you wanted it on a separate line for text-only emails then you could duplicate the "a href" line but remove the "a href" markup around it. Then HTML emails will get duplicate links though.
    .

    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.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. No option to send customer emails.
    By annav in forum General Questions
    Replies: 4
    Last Post: 4 Aug 2010, 03:40 PM
  2. How do I send BCC to myself when I Send Email to Customer?
    By Zinfandel in forum General Questions
    Replies: 3
    Last Post: 20 Aug 2008, 01:55 PM
  3. How to send manual download link without requiring purchase?
    By mlm2005 in forum General Questions
    Replies: 3
    Last Post: 8 Jul 2006, 12:55 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