{"id":60911,"date":"2025-04-26T11:05:36","date_gmt":"2025-04-26T03:05:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60911\/"},"modified":"2025-04-26T11:05:36","modified_gmt":"2025-04-26T03:05:36","slug":"%e5%85%b3%e9%97%adzencart%e7%9a%84%ef%bc%82tell-a-friend%ef%bc%82%e5%8f%91%e9%80%81%e9%82%ae%e4%bb%b6%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60911\/","title":{"rendered":"\u5173\u95edZenCart\u7684\uff02tell a friend\uff02\u53d1\u9001\u90ae\u4ef6\u529f\u80fd"},"content":{"rendered":"<p> ZenCart\u7684\u6f0f\u6d1e\u548c\u5b83\u4e00\u6837\u6d41\u884c.\u4f46\u662f\u56e0\u7279\u7f51\u4e0a\u8fd8\u662f\u6709N\u591a\u7684\u7ad9\u6ca1\u6709\u5347\u7ea7,\u5373\u4f7f\u6709\u8865\u4e01\u53d1\u5e03,\u90a3\u4e9b\u6f0f\u6d1e\u4f9d\u7136\u5927\u95e8\u655e\u5f00\uff0c\u518d\u597d\u7684\u7cfb\u7edf\u7ba1\u7406\u5458\u4e5f\u65e0\u7528,\u56e0\u4e3a\u540e\u95e8\u603b\u662f\u5f00\u7740\u554a.<\/p>\n<p> &nbsp;<\/p>\n<p> \u4eca\u5929\u78b0\u5230\u8fd9\u6837\u7684\u4e00\u4e2a\u95ee\u9898<\/p>\n<p> &nbsp;<\/p>\n<p> \u5728\u65b0\u4ea7\u751f\u65b0\u8ba2\u5355\u65f6,magento\u540e\u53f0\u6ca1\u6709\u53d1\u786e\u8ba4\u4fe1\u3002\u6211\u76f4\u63a5\u7684\u53cd\u5e94\u662f\u4e0d\u53ef\u80fd\u554a\uff0c\u56e0\u4e3a\u4e00\u76f4\u90fd\u5f88\u6b63\u5e38\u554a\uff0c\u800c\u4e14\u6ca1\u6709\u4fee\u6539\u8fc7\u4ee3\u7801\uff1f\u4ed4\u7ec6\u4e00\u60f3\uff0c\u8fd8\u6709\u4e00\u4e2a\u53ef\u4ee5\u80af \u5b9a\u5c31\u662f\u6628\u5929\u6709\u6536\u5230\u4e00\u5c01\u90ae\u4ef6\uff0c\u4e00\u4e2a\u5ba2\u6237\u8bf4\u6536\u5230\u4e86\u65b0\u8ba2\u5355\u786e\u8ba4\u90ae\u4ef6\uff0c\u4f46\u662f\u6ca1\u6709\u8fdb\u5165\u4ed8\u6b3e\u9875\u9762\u3002\u6240\u4ee5\u8fd9\u5c31\u6709\u8305\u76fe\u3002\u8fdb\u4e00\u6b65\u786e\u8ba4\u662fmagento\u7f51\u7ad9\u7684contact us\u53ef\u4ee5\u53d1\u51fa\u90ae\u4ef6\u3002<\/p>\n<p> &nbsp;<\/p>\n<p> \u67e5\u770bmailog\u53d1\u73b0\u670d\u52a1\u5668\u5728\u53d1\u5927\u91cf\u7684\u90ae\u4ef6\u3002\u6000\u7591\u670d\u52a1\u5668\u8ba9\u4eba\u5229\u7528\u53d1\u5783\u573e\u90ae\u4ef6\uff0c\u9996\u5148\u60f3\u5230\u7684\u662fzen cart\u7f51\u7ad9\u3002\u67e5\u770bapache\u7684\u65e5\u5fd7,\u786e\u8ba4\u53d1\u73b0\u6709\u5bf9zen cart\u7684tell-a-friend\u9875\u9762\u7684\u5927\u91cf\u8bbf\u95ee\u91cf\u3002<\/p>\n<p> &nbsp;<\/p>\n<p> \u5173\u95edsendmail<\/p>\n<p> \u6e05\u7a7a<\/p>\n<p> \/var\/spool\/mqueue<\/p>\n<p> \/var\/spool\/clientqueue<\/p>\n<p> \u5c06\u53d1\u5783\u573e\u90ae\u4ef6\u7684IP\u4eceapache\u7684access log\u4e2d\u63d0\u53d6\uff0c\u6682\u65f6\u7528iptable\u89c4\u5219drop\u6389\u6240\u6765\u606f\u8fd9\u51e0\u4e2aIP\u7684\u7684\u8bf7\u6c42<\/p>\n<p> \u542f\u52a8sendmail<\/p>\n<p> \u6700\u91cd\u8981\u7684\u662f\u5982\u4f55\u5b8c\u5168\u7684zen cart\u7684\u7ed9\u670b\u53cb\u53d1\u90ae\u4ef6\u63a8\u8350\u4ea7\u54c1\u7684\u529f\u80fd\u5f7b\u5e95\u5173\u95ed\u6389<\/p>\n<p> &nbsp;<\/p>\n<p> \u9996\u5148\uff0c\u5173\u95ed\u6389\u6240\u6709\u4ea7\u54c1\u9875\u9762\u7684&#8221;tell a friend\u201d\u6309\u94ae<\/p>\n<p> \u83dc\u5355Catalog&nbsp;\u5b50\u83dc\u5355 Product Types \u70b9\u51fb Edit Layout&nbsp; \u6309\u94ae \u5728\u9875\u9762\u4e2d\u9009\u62e9&nbsp;Show Product Tell A Friend Button \u8fd9\u4e2a\u9009\u9879\u7f16\u8f91\uff0c\u4fee\u6539\u4e3a false\u7136\u540e\u5355\u51fb update \u4fdd\u5b58<\/p>\n<p> &nbsp;<\/p>\n<p> \u5176\u6b21\uff0c\u5173\u95ed\u6389\u6240\u6709\u7684&#8221;tell a friend\u201d\u7684sidebox<\/p>\n<p> \u9009\u9879\u83dc\u5355Tools \u5b50\u83dc\u5355&nbsp;&nbsp;Layout Box Controller\uff0c\u5728\u9875\u9762\u4e2d\u627e\u5230 &#8220;sideboxes\/tell_a_friend.php&#8221;,\u9009\u4e2d\u6240\u6709\u7684off\uff0c\u4fdd\u5b58<\/p>\n<p> &nbsp;<\/p>\n<p> \u8fd9\u5176\u5b9e\u8fd8\u4e0d\u591f\uff0c\u77e5\u9053\u5730\u5740\u7684\u4eba\u8fd8\u662f\u53ef\u4ee5\u8fdb\u5165\u5230\u53d1\u90ae\u4ef6\u7684\u9875\u9762\u3002\u6240\u4ee5\uff0c\u8981\u5728\u4ee3\u7801\u4e2d\u7981\u7528\u53d1\u90ae\u4ef6\u7684\u529f\u80fd\u3002\u8fd9\u4e0d\u53ef\u80fd\uff0c\u56e0\u4e3a\u53d1\u90ae\u4ef6\u7684\u529f\u80fd\u8fd8\u662f\u8981\u7528\u7684\u3002\u90a3\u4ec0\u4e48\u529e\uff1f\u6709\u4e24\u4e2a\u9009\u9879\uff1a<\/p>\n<p> &nbsp;<\/p>\n<p> 1\uff0c\u5229\u7528zen cart\u81ea\u5e26\u7684\u914d\u7f6e\u673a\u5236\uff0c\u4f46\u662f\u5728\u540e\u53f0\u662f\u65e0\u6cd5\u505a\u5230\u7684\uff0c\u6211\u662f\u5728\u67e5\u770b\u4ee3\u7801\u4e4b\u540e\u770b\u6ce8\u91ca\u770b\u5230\u7684<\/p>\n<p> \u6211\u7528grep -r &#8216;mail(&#8216; includes\u641c\u7d22php\u7684mail\u51fd\u6570\uff0c\u627e\u5230\u6587\u4ef6 includes\/functions\/functions_email.php\uff0c\u770b\u5230\u8fd9\u6bb5\u4ee3\u7801<\/p>\n<p> &#8230;<\/p>\n<p> &#8230;<\/p>\n<p> \/**<br \/> &nbsp;* Send email (text\/html) using MIME. This is the central mail function.<br \/> &nbsp;* If using &#8220;PHP&#8221; transport method, the SMTP Server or other mail application should be configured correctly in server&#8217;s php.ini<br \/> &nbsp;*<br \/> &nbsp;* @param string $to_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The name of the recipient, e.g. &#8220;Jim Johanssen&#8221;<br \/> &nbsp;* @param string $to_email_address&nbsp; The email address of the recipient, e.g.&nbsp;john.smith@hzq.com<br \/> &nbsp;* @param string $email_subject&nbsp;&nbsp;&nbsp;&nbsp; The subject of the eMail<br \/> &nbsp;* @param string $email_text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The text of the email, may contain HTML entities<br \/> &nbsp;* @param string $from_email_name&nbsp;&nbsp; The name of the sender, e.g. Shop Administration<br \/> &nbsp;* @param string $from_email_adrdess The email address of the sender, e.g.&nbsp;info@myzenshop.com<br \/> &nbsp;* @param array&nbsp; $block&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Array containing values to be inserted into HTML-based email template<br \/> &nbsp;* @param string $module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The module name of the routine calling zen_mail. Used for HTML template selection and email archiving.<br \/> &nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is passed to the archive function denoting what module initiated the sending of the email<br \/> &nbsp;* @param array&nbsp; $attachments_list&nbsp; Array of attachment names\/mime-types to be included&nbsp; (this portion still in testing, and not fully reliable)<br \/> **\/<br \/> &nbsp; function zen_mail($to_name, $to_address, $email_subject, $email_text, $from_email_name, $from_email_address, $block=array(), $module=&#8217;default&#8217;, $attachments_list=&#8221; )<\/p>\n<p> &#8230;<\/p>\n<p> &#8230;<\/p>\n<p> \/\/ ignore sending emails for any of the following pages<br \/> &nbsp;&nbsp;&nbsp; \/\/ (The EMAIL_MODULES_TO_SKIP constant can be defined in a new file in the &#8220;extra_configures&#8221; folder)<br \/> &nbsp;&nbsp;&nbsp; if (defined(&#8216;EMAIL_MODULES_TO_SKIP&#8217;) &amp;&amp; in_array($module,explode(&#8220;,&#8221;,constant(&#8216;EMAIL_MODULES_TO_SKIP&#8217;)))) return false;<\/p>\n<p> &nbsp;&nbsp;&nbsp; \/\/ check for injection attempts. If new-line characters found in header fields, simply fail to send the message<br \/> &nbsp;&nbsp;&nbsp; foreach(array($from_email_address, $to_address, $from_email_name, $to_name, $email_subject) as $key=&gt;$value) {<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (eregi(&#8220;\/r&#8221;,$value) || eregi(&#8220;\/n&#8221;,$value)) return false;<br \/> &nbsp;&nbsp;&nbsp; }<\/p>\n<p> &#8230;<\/p>\n<p> &#8230;<\/p>\n<p> \u6211\u5148\u662f\u770b\u5230$module\u53c2\u6570\uff0c\u867d\u7136\u6ce8\u91ca\u8bf4\u662f\u4e3a\u4e86\u8c03\u7528\u6a21\u677f\u4e4b\u7528\uff0c\u4f46\u662f\u6211\u60f3\u5373\u4f7fzen cart\u6ca1\u505a\uff0c\u6211\u4eec\u81ea\u5df1\u8981\u4fee\u6539\u4e5f\u5e94\u8be5\u662f\u8981\u5229\u7528\u8fd9\u4e2a\u53c2\u6570\u6765\u5b9e\u73b0\u3002\u4f46\u662f\u4ece&nbsp;&nbsp;(The EMAIL_MODULES_TO_SKIP constant can be defined in a new file in the &#8220;extra_configures&#8221; folder) \u8868\u660e\uff0c\u6211\u4eec\u53ea\u8981\u5728extra_configures\u76ee\u5f55\u4e0b\u5b9a\u4e49\u4e00\u4e2aEMAIL_MODULES_TO_SKIP\u8fd9\u4e2a\u5e38\u91cf\u5c31OK\u4e86\uff0c\u6211\u662f\u8fd9\u6837\u505a\u7684\uff1a<\/p>\n<p> &nbsp;<\/p>\n<p> &nbsp;define(&#8216;EMAIL_MODULES_TO_SKIP&#8217;, &#8216;tell_a_friend,tell_a_friend_extra&#8217;);<\/p>\n<p> &nbsp;<\/p>\n<p> \u4e0d\u8fc7\uff0c\u5728\u6211\u6d4b\u8bd5\u7684\u8fd9\u4e2a\u7248\u672c\u4e2d\uff0c1.3.8\u4e2d\u5373\u4f7f\u8fd9\u6837\u8bbe\u7f6e\u540e\uff0c\u4e5f\u4f1a\u63d0\u793a\u53d1\u9001\u6210\u529f\uff0c\u4f46\u662f\u5176\u5b9e\u662f\u6ca1\u6709\u53d1\u9001\u7684\u3002<\/p>\n<p> &nbsp;<\/p>\n<p> \u53e6\u5916\u4e00\u79cd\u65b9\u6cd5\u5c31\u662f\u7981\u6b62\u5bf9tell_a_friend\u9875\u9762\u7684\u8bf7\u6c42\uff0c\u6216\u8005\u901a\u8fc7mod_rewrite\u5c06\u5bf9\u8fd9\u4e2a\u9875\u9762\u7684\u8bf7\u6c42\u91cd\u5b9a\u5411\u5230\u4ea7\u54c1\u9875\u6216\u9996\u9875\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ZenCart\u7684\u6f0f\u6d1e\u548c\u5b83\u4e00\u6837\u6d41\u884c.\u4f46\u662f\u56e0\u7279\u7f51\u4e0a\u8fd8\u662f\u6709N\u591a\u7684\u7ad9\u6ca1\u6709\u5347\u7ea7,\u5373\u4f7f\u6709\u8865\u4e01\u53d1\u5e03,\u90a3\u4e9b\u6f0f\u6d1e\u4f9d\u7136\u5927\u95e8\u655e\u5f00\uff0c\u518d\u597d\u7684\u7cfb\u7edf\u7ba1\u7406\u5458\u4e5f\u65e0\u7528,\u56e0\u4e3a\u540e\u95e8\u603b\u662f\u5f00\u7740\u554a. &nbsp; \u4eca\u5929\u78b0\u5230\u8fd9\u6837\u7684\u4e00\u4e2a\u95ee\u9898 &nbsp; \u5728\u65b0\u4ea7\u751f\u65b0\u8ba2\u5355\u65f6,magento\u540e\u53f0\u6ca1\u6709\u53d1\u786e\u8ba4\u4fe1\u3002\u6211\u76f4\u63a5\u7684\u53cd\u5e94\u662f\u4e0d\u53ef\u80fd\u554a\uff0c\u56e0\u4e3a\u4e00\u76f4\u90fd\u5f88\u6b63\u5e38\u554a\uff0c\u800c\u4e14\u6ca1\u6709\u4fee\u6539\u8fc7\u4ee3\u7801\uff1f\u4ed4\u7ec6\u4e00\u60f3\uff0c\u8fd8\u6709\u4e00\u4e2a\u53ef\u4ee5\u80af \u5b9a\u5c31\u662f\u6628\u5929\u6709\u6536\u5230\u4e00\u5c01\u90ae\u4ef6\uff0c\u4e00\u4e2a\u5ba2\u6237\u8bf4\u6536\u5230\u4e86\u65b0\u8ba2\u5355\u786e\u8ba4\u90ae\u4ef6\uff0c\u4f46\u662f\u6ca1\u6709\u8fdb\u5165\u4ed8\u6b3e\u9875\u9762\u3002\u6240\u4ee5\u8fd9\u5c31\u6709\u8305\u76fe\u3002\u8fdb\u4e00\u6b65\u786e\u8ba4\u662fmagento\u7f51\u7ad9\u7684contact us\u53ef\u4ee5\u53d1\u51fa\u90ae\u4ef6\u3002 &nbsp; \u67e5\u770bmailog\u53d1\u73b0\u670d\u52a1\u5668\u5728\u53d1\u5927\u91cf\u7684\u90ae\u4ef6\u3002\u6000\u7591\u670d\u52a1\u5668\u8ba9\u4eba\u5229\u7528\u53d1\u5783\u573e\u90ae\u4ef6\uff0c\u9996\u5148\u60f3\u5230\u7684\u662fzen cart\u7f51\u7ad9\u3002\u67e5\u770bapache\u7684\u65e5\u5fd7,\u786e\u8ba4\u53d1\u73b0\u6709\u5bf9zen cart\u7684tell-a-friend\u9875\u9762\u7684\u5927\u91cf\u8bbf\u95ee\u91cf\u3002 &nbsp; \u5173\u95edsendmail \u6e05\u7a7a \/var\/spool\/mqueue \/var\/spool\/clientqueue \u5c06\u53d1\u5783\u573e\u90ae\u4ef6\u7684IP\u4eceapache\u7684access log\u4e2d\u63d0\u53d6\uff0c\u6682\u65f6\u7528iptable\u89c4\u5219drop\u6389\u6240\u6765\u606f\u8fd9\u51e0\u4e2aIP\u7684\u7684\u8bf7\u6c42 \u542f\u52a8sendmail \u6700\u91cd\u8981\u7684\u662f\u5982\u4f55\u5b8c\u5168\u7684zen cart\u7684\u7ed9\u670b\u53cb\u53d1\u90ae\u4ef6\u63a8\u8350\u4ea7\u54c1\u7684\u529f\u80fd\u5f7b\u5e95\u5173\u95ed\u6389 &nbsp; \u9996\u5148\uff0c\u5173\u95ed\u6389\u6240\u6709\u4ea7\u54c1\u9875\u9762\u7684&#8221;tell a friend\u201d\u6309\u94ae \u83dc\u5355Catalog&nbsp;\u5b50\u83dc\u5355 Product Types \u70b9\u51fb Edit Layout&nbsp; \u6309\u94ae \u5728\u9875\u9762\u4e2d\u9009\u62e9&nbsp;Show Product Tell A Friend Button \u8fd9\u4e2a\u9009\u9879\u7f16\u8f91\uff0c\u4fee\u6539\u4e3a false\u7136\u540e\u5355\u51fb update \u4fdd\u5b58 &nbsp; \u5176\u6b21\uff0c\u5173\u95ed\u6389\u6240\u6709\u7684&#8221;tell a friend\u201d\u7684sidebox \u9009\u9879\u83dc\u5355Tools \u5b50\u83dc\u5355&nbsp;&nbsp;Layout Box Controller\uff0c\u5728\u9875\u9762\u4e2d\u627e\u5230 &#8220;sideboxes\/tell_a_friend.php&#8221;,\u9009\u4e2d\u6240\u6709\u7684off\uff0c\u4fdd\u5b58 &nbsp; \u8fd9\u5176\u5b9e\u8fd8\u4e0d\u591f\uff0c\u77e5\u9053\u5730\u5740\u7684\u4eba\u8fd8\u662f\u53ef\u4ee5\u8fdb\u5165\u5230\u53d1\u90ae\u4ef6\u7684\u9875\u9762\u3002\u6240\u4ee5\uff0c\u8981\u5728\u4ee3\u7801\u4e2d\u7981\u7528\u53d1\u90ae\u4ef6\u7684\u529f\u80fd\u3002\u8fd9\u4e0d\u53ef\u80fd\uff0c\u56e0\u4e3a\u53d1\u90ae\u4ef6\u7684\u529f\u80fd\u8fd8\u662f\u8981\u7528\u7684\u3002\u90a3\u4ec0\u4e48\u529e\uff1f\u6709\u4e24\u4e2a\u9009\u9879\uff1a &nbsp; 1\uff0c\u5229\u7528zen [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-60911","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=60911"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60911\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}