Author: ashish
Date: Mon Apr  5 11:25:08 2010
New Revision: 930842

URL: http://svn.apache.org/viewvc?rev=930842&view=rev
Log:
Applied patch from jira issue - OFBIZ-3635 - Contact list unsubscription email 
notification.
Thanks Chandan for the contribution.

Added:
    
ofbiz/trunk/specialpurpose/ecommerce/templates/email/ContactListUnsubscribeEmail.ftl
   (with props)
Modified:
    
ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml
    ofbiz/trunk/applications/marketing/servicedef/secas.xml
    ofbiz/trunk/applications/marketing/servicedef/services.xml
    ofbiz/trunk/applications/party/data/PartyTypeData.xml
    ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
    
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/viewprofile.ftl
    ofbiz/trunk/specialpurpose/ecommerce/widget/EmailContactListScreens.xml

Modified: 
ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml?rev=930842&r1=930841&r2=930842&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml
 (original)
+++ 
ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml
 Mon Apr  5 11:25:08 2010
@@ -161,6 +161,10 @@ under the License.
         </if-not-empty>
         <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
         <store-value value-field="lookedUpValue"/>
+        <set field="productStoreId" from-field="parameters.productStoreId"/>
+        <field-to-result field="productStoreId" result-name="productStoreId" />
+        <set field="contactListId" from-field="parameters.contactListId"/>
+        <field-to-result field="contactListId" result-name="contactListId" />
     </simple-method>
     <simple-method method-name="updatePartyEmailContactListParty" 
short-description="Update ContactList Party Contact Mech">
         <set field="lookupMap.preferredContactMechId" 
from-field="parameters.oldContactMechId"/>
@@ -360,4 +364,31 @@ under the License.
             </iterate>
         </if-not-empty>                                       
     </simple-method>       
+    
+    <simple-method method-name="sendContactListPartyUnSubscribeEmail" 
short-description="Send contact list party unsubscribe email" 
login-required="true">
+        <set field="productStoreId" type="String" 
from-field="parameters.productStoreId"/>
+        <entity-one entity-name="ProductStoreEmailSetting" 
value-field="storeEmail" auto-field-map="false">
+            <field-map field-name="productStoreId" 
from-field="productStoreId"/>
+            <field-map field-name="emailType" value="UNSUB_CONT_LIST_NOTI"/>
+        </entity-one>
+        <entity-and entity-name="PartyContactMechPurpose" 
list="partyContactMechPurposes">
+            <field-map field-name="partyId" from-field="userLogin.partyId"/>
+            <field-map field-name="contactMechPurposeTypeId" 
value="PRIMARY_EMAIL"/>
+        </entity-and>
+        <first-from-list list="partyContactMechPurposes" 
entry="partyContactMechPurpose"/>
+        <entity-one entity-name="ContactMech" value-field="contactMech" 
auto-field-map="false">
+            <field-map field-name="contactMechId" 
from-field="partyContactMechPurpose.contactMechId"/>
+        </entity-one>
+        <if-not-empty field="storeEmail.bodyScreenLocation">
+            <set field="bodyParameters.contactListId" 
from-field="parameters.contactListId"/>
+            <set field="bodyParameters.partyId" 
from-field="userLogin.partyId"/>
+            <set field="emailParams.bodyParameters" 
from-field="bodyParameters"/>
+            <set field="emailParams.userLogin" from-field="userLogin"/>
+            <set field="emailParams.sendTo" 
from-field="contactMech.infoString"/>
+            <set field="emailParams.sendFrom" 
from-field="storeEmail.fromAddress"/>
+            <set field="emailParams.subject" from-field="storeEmail.subject"/>
+            <set field="emailParams.bodyScreenUri" 
from-field="storeEmail.bodyScreenLocation"/>
+            <call-service service-name="sendMailFromScreen" 
in-map-name="emailParams"/>
+        </if-not-empty>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/marketing/servicedef/secas.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/servicedef/secas.xml?rev=930842&r1=930841&r2=930842&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/marketing/servicedef/secas.xml Mon Apr  5 11:25:08 
2010
@@ -27,6 +27,10 @@ under the License.
     <eca service="updatePartyEmailAddress" event="return">
         <action service="updatePartyEmailContactListParty" mode="sync"/>
     </eca>
+    <eca service="updateContactListParty" event="commit">
+        <condition field-name="statusId" operator="equals" 
value="CLPT_REJECTED"/>
+        <action service="sendContactListPartyUnSubscribeEmail" mode="sync" 
persist="true"/>
+    </eca>
     
     <!--  update contact list communication status -->
     <eca service="updateCommunicationEvent" event="commit">

Modified: ofbiz/trunk/applications/marketing/servicedef/services.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/servicedef/services.xml?rev=930842&r1=930841&r2=930842&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/marketing/servicedef/services.xml Mon Apr  5 
11:25:08 2010
@@ -144,6 +144,8 @@ under the License.
         <description>Update Party to ContactList Join</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>        
+        <attribute name="productStoreId" type="String" mode="INOUT" 
optional="true"/>
+        <attribute name="contactListId" type="String" mode="INOUT" 
optional="true"/>
         <attribute name="optInVerifyCode" type="String" mode="IN" 
optional="true"/>
         <override name="fromDate" optional="true"/>
     </service>
@@ -181,6 +183,14 @@ under the License.
         <attribute name="communicationEventId" type="String" mode="IN" 
optional="false"/>
         <attribute name="contactListId" type="String" mode="OUT" 
optional="true"/>
     </service>
+    <service name="sendContactListPartyUnSubscribeEmail" engine="simple"
+        
location="component://marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml"
 invoke="sendContactListPartyUnSubscribeEmail" auth="false">
+        <attribute name="productStoreId" mode="IN" type="String" 
optional="true"/>
+        <attribute name="partyId" mode="IN" type="String" optional="true"/>
+        <attribute name="contactListId" mode="IN" type="String" 
optional="true"/>
+        <attribute name="fromDate" mode="IN" type="String" optional="true"/>
+        <attribute name="statusId" mode="IN" type="String" optional="true"/>
+    </service>
 
     <!--  ContactList Comm Status Services -->
     <service name="updateContactListCommStatus" engine="simple" 
default-entity-name="ContactListCommStatus"

Modified: ofbiz/trunk/applications/party/data/PartyTypeData.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartyTypeData.xml?rev=930842&r1=930841&r2=930842&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/data/PartyTypeData.xml (original)
+++ ofbiz/trunk/applications/party/data/PartyTypeData.xml Mon Apr  5 11:25:08 
2010
@@ -152,6 +152,7 @@ under the License.
     <Enumeration description="Party Email Address Verification" 
enumCode="EMAIL_VERIFY" enumId="PRDS_EMAIL_VERIFY" sequenceId="03" 
enumTypeId="PARTY_EMAIL"/>
     <Enumeration description="Party Invitation" enumCode="INVITE_EMAIL" 
enumId="PRDS_PARTYINV_EMAIL" sequenceId="04" enumTypeId="PARTY_EMAIL"/>
     <Enumeration description="Contact-Us Notification" enumCode="CONT_EMAIL" 
enumId="CONT_NOTI_EMAIL" sequenceId="05" enumTypeId="PARTY_EMAIL"/>
+    <Enumeration description="Unsubscribe Contact List Notification" 
enumCode="UNSUB_CONT_EMAIL" enumId="UNSUB_CONT_LIST_NOTI" sequenceId="01" 
enumTypeId="PARTY_EMAIL"/>
 
     <!-- the groups which are the main roles on he party listing -->
     <RoleType description="Main Role" hasTable="N" parentTypeId="" 
roleTypeId="MAIN_ROLE"/>

Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=930842&r1=930841&r2=930842&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Mon Apr  5 
11:25:08 2010
@@ -123,6 +123,8 @@ under the License.
     <ProductStoreEmailSetting productStoreId="9000" 
emailType="PRDS_EMAIL_VERIFY" 
bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#VerifyEmailAddressNotification"
 subject="Email Address Verification" bccAddress="[email protected]" 
fromAddress="[email protected]"/>
 
     <ProductStoreEmailSetting productStoreId="9000" 
emailType="CONT_NOTI_EMAIL" 
bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactUsEmailNotification"
 subject="Contact-us Information Notification" 
fromAddress="[email protected]" />
+    
+    <ProductStoreEmailSetting productStoreId="9000" 
emailType="UNSUB_CONT_LIST_NOTI" 
bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactListUnsubscribeEmail"
 subject="Unsubscribe Contact List" fromAddress="[email protected]"/>
 
     <WebAnalyticsConfig productStoreId="9000" 
webAnalyticsTypeId="GOOGLE_ANALYTICS" webAnalyticsCode="123456" isEnabled="Y" 
description="This is code provided from google analytics" 
contentId="GOOGLE_ANA_CNT"/>
     <WebAnalyticsConfig productStoreId="9000" 
webAnalyticsTypeId="BING_ANALYTICS" webAnalyticsCode="123456" isEnabled="Y" 
description="This is code provided from bing analytics" 
contentId="BING_ANA_CNT"/>

Added: 
ofbiz/trunk/specialpurpose/ecommerce/templates/email/ContactListUnsubscribeEmail.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/templates/email/ContactListUnsubscribeEmail.ftl?rev=930842&view=auto
==============================================================================
--- 
ofbiz/trunk/specialpurpose/ecommerce/templates/email/ContactListUnsubscribeEmail.ftl
 (added)
+++ 
ofbiz/trunk/specialpurpose/ecommerce/templates/email/ContactListUnsubscribeEmail.ftl
 Mon Apr  5 11:25:08 2010
@@ -0,0 +1,24 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <body>
+    <p class="tabletext">Hello ${partyName.firstName?if_exists} 
${partyName.lastName?if_exists} ${partyName.groupName?if_exists}!</p>
+    <p class="tabletext">Successfully unsubscribed from 
${contactList.contactListName} contact list.</p>
+  </body>
+</html>

Propchange: 
ofbiz/trunk/specialpurpose/ecommerce/templates/email/ContactListUnsubscribeEmail.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
ofbiz/trunk/specialpurpose/ecommerce/templates/email/ContactListUnsubscribeEmail.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: 
ofbiz/trunk/specialpurpose/ecommerce/templates/email/ContactListUnsubscribeEmail.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/viewprofile.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/viewprofile.ftl?rev=930842&r1=930841&r2=930842&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/viewprofile.ftl 
(original)
+++ 
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/viewprofile.ftl 
Mon Apr  5 11:25:08 2010
@@ -487,6 +487,8 @@ under the License.
           <#if (contactListParty.statusId?if_exists == "CLPT_ACCEPTED")>       
     
             <form method="post" 
action="<@ofbizUrl>updateContactListParty</@ofbizUrl>" 
name="clistRejectForm${contactListParty_index}">
             <div>
+              <#assign productStoreId = 
Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request) 
/>
+              <input type="hidden" name="productStoreId" 
value="${productStoreId?if_exists}" />
               <input type="hidden" name="partyId" value="${party.partyId}"/>
               <input type="hidden" name="contactListId" 
value="${contactListParty.contactListId}"/>
               <input type="hidden" name="fromDate" 
value="${contactListParty.fromDate}"/>

Modified: 
ofbiz/trunk/specialpurpose/ecommerce/widget/EmailContactListScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/EmailContactListScreens.xml?rev=930842&r1=930841&r2=930842&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/widget/EmailContactListScreens.xml 
(original)
+++ ofbiz/trunk/specialpurpose/ecommerce/widget/EmailContactListScreens.xml Mon 
Apr  5 11:25:08 2010
@@ -61,4 +61,16 @@ under the License.
             </widgets>
         </section>
     </screen>
+
+    <screen name="ContactListUnsubscribeEmail">
+        <section>
+            <actions>
+                <entity-one entity-name="ContactList" 
value-field="contactList"/>
+                <entity-one entity-name="PartyNameView" 
value-field="partyName"/>
+            </actions>
+            <widgets>
+                <platform-specific><html><html-template 
location="component://ecommerce/templates/email/ContactListUnsubscribeEmail.ftl"/></html></platform-specific>
+            </widgets>
+        </section>
+    </screen>
 </screens>


Reply via email to