Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    174
    Plugin Contributions
    0

    Default Removing spam disclaimer from transactional mails

    Hi all,
    ZC 1.5.6c, MariaDB 10.3.20, PHP 7.3.11, built-in responsive classic template with Japanese support additions and a couple of modules (more info if needed).

    After setting up English and Japanese spam disclaimer definitions for Japanese regulations, I realize I do not want the disclaimer on transactional mails, only on commercial mails. While I am not yet sure how to categorize all the various mail types Zen Cart is capable of sending, for now I have removed the disclaimer in mails for orders, order status changes, password forgotten, and mails deriving from the contact us form.

    Problem is, I could not find a straight-forward way to do this. There are text and HTML formatted mails, all of which are sent using the zen_mail function in includes/functions/functions_email.php.

    For HTML mails, the various fields for use with the HTML mail templates are actually defined one by one, and then passed to zen_mail. So for this type of mail, the spam disclaimer (while it actually does not currently seem to be used) can apparently rather simply be set to html['EMAIL_SPAM_DISCLAIMER'] => 0 in an attached array passed to zen_mail.

    However, for text mails, the mails are built up from the raw defines() in the language files, which are constants. Instead of creating variables and working with those, I see in zen_mail that the disclaimers are always placed in mails, except for xml_record type mails (which I have not found being used anywhere).

    My solution, very dirty for now just to test if it gets the job done, is to list inside that condition, the further mail module names for which I do not want the spam disclaimer to be sent. For now, that becomes the following:
    PHP Code:
          if ($module != 'xml_record') {
            if (
    defined('EMAIL_DISCLAIMER') && EMAIL_DISCLAIMER != '' && !strstr($email_textsprintf(EMAIL_DISCLAIMERSTORE_OWNER_EMAIL_ADDRESS)) && $to_email_address != STORE_OWNER_EMAIL_ADDRESS && !defined('EMAIL_DISCLAIMER_NEW_CUSTOMER')) $email_text .= "\n" sprintf(EMAIL_DISCLAIMERSTORE_OWNER_EMAIL_ADDRESS);
            if ((
    $module != 'contact_us') && ($module != 'password_forgotten') && ($module != 'checkout') && ($module != 'checkout_extra') && ($module != 'order_status') && ($module != 'order_status_extra') && ($module != 'purchase_order') && ($module != 'payment_modules') && ($module != 'payment_modules_extra')) {
                if (
    defined('EMAIL_SPAM_DISCLAIMER') && EMAIL_SPAM_DISCLAIMER != '' && !strstr($email_textEMAIL_SPAM_DISCLAIMER) && $to_email_address != STORE_OWNER_EMAIL_ADDRESS$email_text .= "\n\n" EMAIL_SPAM_DISCLAIMER;
            }
          } 
    Is there any clean way to control the use of spam disclaimer, or for that matter, some differentiation of transactional and commercial mails in Zen Cart?
    Any comments, insights or advice welcome.
    Last edited by gernot; 29 Nov 2019 at 04:09 PM.
    Zen Cart 1.5.6c modified to support Japanese language (postage module support work in progress). Upgraded incrementally each version from initial 1.5.5d.

 

 

Similar Threads

  1. Receiving spam e-mails from HTML contact form
    By brillarmory in forum General Questions
    Replies: 21
    Last Post: 21 Mar 2018, 06:26 PM
  2. v153 Removing Spam Reviews
    By TechDude in forum General Questions
    Replies: 5
    Last Post: 29 Jun 2016, 07:34 AM
  3. Spam Disclaimer
    By RoPey in forum General Questions
    Replies: 5
    Last Post: 21 Apr 2009, 11:42 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