Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    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.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Removing spam disclaimer from transactional mails

    You could modify the email templates (on a per-language basis, if needed) to remove that SPAM disclaimer 'insertion', noting that this has been done for zc157.

    For example, editing the zc156c /email/email_template_checkout.html, to remove the highlighted line:
    Code:
    </div>
    <div class="disclaimer">
      <div class="disclaimer1">$EMAIL_DISCLAIMER</div>
      <div class="disclaimer2">$EMAIL_SPAM_DISCLAIMER</div>
    </div>
    Update: Whoops! That will work for the HTML emails, but not for the TEXT.

  3. #3
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Removing spam disclaimer from transactional mails

    Hi lat9,
    That is indeed an excellent idea, and I too considered it would be the most simple for now (I am not really a fan of such operations, since I know how hard they are to maintain). Anyhow, I did think about doing that. I do have a language-dependent mail template directory now, although there are no contents in the file templates that are hard-coded language-dependent yet (the templates consist of parameters, which themselves have language-dependent content created by Zen Cart).
    However, I found I could not easily figure out when particular email file templates were being used. It was more clean in my mind to directly follow the module name being used in calls to zen_mail (although my way of handling the cases is certainly not clean!).
    And as you say, it works only for the HTML templates. The text-based mail seems to be output directly without use of templates.
    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.

  4. #4
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Removing spam disclaimer from transactional mails

    Just to separate the issues a bit:
    I think it would be a good design idea to distinguish transactional and commercial mails. As far as I have seen in looking at the laws of a variety of countries, the spam laws only apply to commercial mails, and transactional mail is defined pretty much the same way, so it should be satisfactory to define such "sets" in Zen Cart in future, maybe adding some kind of a tag in addition to a module name for mail sending, for example.
    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.

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Removing spam disclaimer from transactional mails

    What would help (but will require additional changes to various email-sending files) would be the creation of, for example, an /email/email_template_checkout.txt that includes the various email-elements like the .html versions. An associated update to the zen_mail function would then 'distribute' the elements in the array passed to the TEXT emails as well as the HTML ones.

    That's not a small task ...

  6. #6
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Removing spam disclaimer from transactional mails

    Glad to know you think that way, makes me more confident that it is possible rather than having to be the way it is now.
    I am happy to go ahead on my side and start creating definitions of the elements on the one hand, and an output mechanism that interfaces to the template files. This latter part could possibly be done first, with essentially empty template files of different names existing (taking everything as a blob for now before the output is broken down into its various elements).
    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.

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,622
    Plugin Contributions
    123

    Default Re: Removing spam disclaimer from transactional mails

    Note that in 1.5.7, the file includes/languages/english/email_extras.php has

    define('EMAIL_SPAM_DISCLAIMER','');
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

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