Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31
  1. #1
    Join Date
    Mar 2008
    Posts
    332
    Plugin Contributions
    0

    Default How to Create an additional Custom Email?

    Hi,

    Our company uses Paypal for processing all of our orders online. We have 2 company names under one Paypal account e.g Company A and B under Paypal account Company A.

    Whenever a customer buys from Company B, they get charged on their credit card under Company A and we are getting problems of disputes from customers who think they are getting unauthorized charges.

    Anyway, we were thinking of creating a custom email that comes after order confirmation that says their credit card was charged under the name "Company A" so that they know beforehand what to expect on their credit card charged.

    Rather than adding the information as a comment (which we have done but have not successfully helped in reducing disputes), we want a separate email sent out.

    How do we go about doing this? Does this entail extensive code modification?

    Any help towards the first step would be greatly appreciated.

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

    Default Re: How to Create Custom Email?

    The existing order-confirmation emails are sent via send_order_emails() inside the /includes/classes/order.php class.
    You could add your own code to send yet another email after the existing ones are sent, perhaps using the simple low-stock email code near the beginning of that section as an example.
    .

    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
    Mar 2008
    Posts
    332
    Plugin Contributions
    0

    Default Re: How to Create Custom Email?

    Thank you DrByte. I have looked at order.php codes and have tracked the low stock email to about line 900:

    if ($this->email_low_stock != '' and SEND_LOWSTOCK_EMAIL=='1') {
    // send an email
    $email_low_stock = SEND_EXTRA_LOW_STOCK_EMAIL_TITLE . "\n\n" . $this->email_low_stock;
    zen_mail('', SEND_EXTRA_LOW_STOCK_EMAILS_TO, EMAIL_TEXT_SUBJECT_LOWSTOCK, $email_low_stock, STORE_OWNER, EMAIL_FROM, array('EMAIL_MESSAGE_HTML' => nl2br($email_low_stock)),'low_stock');
    }

    Is this what I would be replicating? and I suppose there has to be a corresponding html template for the new email? e.g email_template_lowstock.html

    Are these just the two files I will be messing with? or are there more that should be created?

    Quote Originally Posted by DrByte View Post
    The existing order-confirmation emails are sent via send_order_emails() inside the /includes/classes/order.php class.
    You could add your own code to send yet another email after the existing ones are sent, perhaps using the simple low-stock email code near the beginning of that section as an example.

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

    Default Re: How to Create Custom Email?

    Yes, that's the example to follow.

    Basically I'd do this:
    Code:
      zen_mail($this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], EMAIL_SUBJECT_CC_MSG, EMAIL_TEXT_CC_MSG, STORE_OWNER, EMAIL_FROM, array('EMAIL_MESSAGE_HTML' => nl2br(EMAIL_TEXT_CC_MSG)),'ccnotice');
    and then in a new language file (ie: /includes/languages/english/extra_definitions/my_cc_msg_text.php ) define the text you want in the emails:
    Code:
    <?php
    define('EMAIL_SUBJECT_CC_MSG', 'An important note about your recent purchase.');
    define('EMAIL_TEXT_CC_MSG', 'Thank you for your recent purchase at ' . STORE_NAME . '.' . "\n\n" . 'We are sending you this message to advise you that your purchase will show up on your credit card statement as "ABCDEFG COMPANY" (our sister company) instead of "' . STORE_NAME . '".  Please make note of this when reviewing your credit card bill. Thank you for your understanding, and we apologize for any confusion this may cause.' . "\n\n" . 'We look forward to you visiting our online store again.');
    Or use the attached files to make it simpler:
    Attached Files Attached Files
    .

    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.

  5. #5
    Join Date
    Mar 2008
    Posts
    332
    Plugin Contributions
    0

    Default Re: How to Create an additional Custom Email?

    Dr. Byte thank you! This works out great! I have another question though, how to do I make it so that we are also copied on the notice?

    Thanks again in advance!!

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

    Default Re: How to Create an additional Custom Email?

    Quote Originally Posted by Decostyle View Post
    Dr. Byte thank you! This works out great! I have another question though, how to do I make it so that we are also copied on the notice?

    Thanks again in advance!!
    Are you sure you really want a bunch of duplicates of those emails? They'll all be identical.

    I suppose you might use it as an audit trail, but I can't see that winning a chargeback case alone. I suppose it might be one of many resources that could win it.
    If you really want a copy, run the zen_mail call again (copy it onto the next line), but change the first 2 parameters to STORE_OWNER and STORE_OWNER_EMAIL_ADDRESS respectively, so that it sends to you instead.
    .

    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.

  7. #7
    Join Date
    Mar 2008
    Posts
    332
    Plugin Contributions
    0

    Default Re: How to Create an additional Custom Email?

    Actually, I was looking at the email as sort of CC where I can see and make sure that the email was sent to the customer and have it on record. I believe using the code you suggested won't show the customer name that it was originally sent to?

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

    Default Re: How to Create an additional Custom Email?

    Quote Originally Posted by Decostyle View Post
    I believe using the code you suggested won't show the customer name that it was originally sent to?
    True enough.

    You could alter it to include the customer's name and email address inside the actual body of the email.

    There's no built-in support for cc/bcc in emails in v1.3.8a or earlier.
    .

    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.

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

    Default Re: How to Create an additional Custom Email?

    Or ... you could change the core code to add bcc support specifically for this email message, similar to how I suggested it to someone here: http://www.zen-cart.com/forum/showpo...26&postcount=2

    You'd have to make a few alterations to that suggested code, like this:
    Code:
          $mail->Subject  = $email_subject;
    
          if ($module == 'ccnotice') {
            $mail->AddBCC(STORE_OWNER_EMAIL_ADDRESS, STORE_NAME);
          }
          
          $mail->From     = $from_email_address;
    .

    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.

  10. #10
    Join Date
    Mar 2008
    Posts
    332
    Plugin Contributions
    0

    Default Re: How to Create an additional Custom Email?

    Hello Dr. Byte,

    I have read through your other post and have this on my functions_email.php:

    if (IS_ADMIN_FLAG === true && $module == 'ccnotice') {
    $mail->AddBCC(STORE_OWNER_EMAIL_ADDRESS, STORE_NAME);
    }


    Tried it and customer gets the cc notice but the store owner email address does not get the bcc. Is it because the 'ccnotice' is not a module?

 

 
Page 1 of 4 123 ... LastLast

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. v151 Create custom mass-email script
    By strelitzia in forum General Questions
    Replies: 6
    Last Post: 16 Mar 2013, 04:48 PM
  4. Replies: 5
    Last Post: 9 Aug 2012, 09:57 PM
  5. How to create additional product listing filters?
    By kwright in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Sep 2011, 01:31 AM

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