You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2012/05/22 10:03:03 UTC

svn commit: r1341341 - in /ofbiz/trunk: applications/party/config/ applications/party/data/ applications/party/script/org/ofbiz/party/party/ applications/party/servicedef/ applications/party/templates/email/ applications/party/widget/partymgr/ specialp...

Author: hansbak
Date: Tue May 22 08:03:02 2012
New Revision: 1341341

URL: http://svn.apache.org/viewvc?rev=1341341&view=rev
Log:
add account activation email type to product store which can be used for the to be approved registrations

Added:
    ofbiz/trunk/applications/party/templates/email/AccountActivatedNotification.ftl   (with props)
Modified:
    ofbiz/trunk/applications/party/config/PartyUiLabels.xml
    ofbiz/trunk/applications/party/data/PartyTypeData.xml
    ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
    ofbiz/trunk/applications/party/servicedef/services.xml
    ofbiz/trunk/applications/party/widget/partymgr/EmailPartyScreens.xml
    ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml

Modified: ofbiz/trunk/applications/party/config/PartyUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/config/PartyUiLabels.xml?rev=1341341&r1=1341340&r2=1341341&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/config/PartyUiLabels.xml (original)
+++ ofbiz/trunk/applications/party/config/PartyUiLabels.xml Tue May 22 08:03:02 2012
@@ -7923,6 +7923,9 @@
         <value xml:lang="zh">如果不重新创建安全组的话,不能修改这个。</value>
         <value xml:lang="zh_TW">如果不重新創建安全組的話,不能修改這個。</value>
     </property>
+    <property key="PartyNotificationMailActivated">
+        <value xml:lang="en">Party Account Activated Notification Mail</value>
+    </property>
     <property key="PartyNotificationMailChange">
         <value xml:lang="en">Change Personal Info Notification Mail</value>
         <value xml:lang="hi_IN">व्यक्तिगत जानकारी अधिसूचना मेल बदलें</value>

Modified: ofbiz/trunk/applications/party/data/PartyTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartyTypeData.xml?rev=1341341&r1=1341340&r2=1341341&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/data/PartyTypeData.xml (original)
+++ ofbiz/trunk/applications/party/data/PartyTypeData.xml Tue May 22 08:03:02 2012
@@ -159,6 +159,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="Account Activated Notification" enumCode="ACCOUNT_ACTIVATED" enumId="PRDS_CUST_ACTIVATED" sequenceId="06" enumTypeId="PARTY_EMAIL"/>
     <Enumeration description="Unsubscribe Contact List Notification" enumCode="UNSUB_CONT_EMAIL" enumId="UNSUB_CONT_LIST_NOTI" sequenceId="01" enumTypeId="PARTY_EMAIL"/>
     <Enumeration description="Subscribe Contact List Notification" enumCode="SUB_CONT_EMAIL" enumId="SUB_CONT_LIST_NOTI" sequenceId="02" enumTypeId="PARTY_EMAIL"/>
     <Enumeration description="Unsubscribe Contact List Verify" enumCode="UNSUB_CONT_VERIFY_EMAIL" enumId="UNSUB_CONT_LIST_VERI" sequenceId="03" enumTypeId="PARTY_EMAIL"/>

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml?rev=1341341&r1=1341340&r2=1341341&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml Tue May 22 08:03:02 2012
@@ -1126,4 +1126,48 @@ under the License.
             <field-to-result result-name="description" field="roleType.description" />
         </if-not-empty>
     </simple-method>
+    
+    <!-- send account activated email notification -->
+    <simple-method method-name="sendAccountActivatedEmailNotification" short-description="Notification email on account activated" login-required="false">
+        <map-to-map map="parameters" to-map="bodyParameters"/>
+        <set field="emailType" value="PRDS_CUST_ACTIVATED"/>
+        <set field="productStoreId" from-field="parameters.productStoreId" />
+        <if-empty field="productStoreId">
+            <log level="warning" message="No productStoreId specified."/>
+        </if-empty>
+        <entity-one entity-name="ProductStoreEmailSetting" value-field="storeEmail">
+            <field-map field-name="emailType"/>
+            <field-map field-name="productStoreId"/>
+        </entity-one>
+        <entity-and list="webSites" entity-name="WebSite">
+            <field-map field-name="productStoreId" from-field="storeEmail.productStoreId"/>
+        </entity-and>
+        <first-from-list entry="webSite" list="webSites"/>
+        <if-not-empty field="storeEmail.bodyScreenLocation">
+            <entity-one entity-name="UserLogin" value-field="userLoginParty"/>
+            <set field="parameters.partyId" from-field="userLoginParty.partyId"/>
+            <entity-condition entity-name="PartyContactDetailByPurpose" list="partyContactDetailByPurposes" filter-by-date="true">
+                <condition-list>
+                    <condition-expr field-name="contactMechPurposeTypeId" operator="equals" value="PRIMARY_EMAIL"/>
+                    <condition-expr field-name="partyId" operator="equals"  from-field="parameters.partyId"/>
+                </condition-list>
+            </entity-condition>
+            <first-from-list entry="partyContactDetailByPurpose" list="partyContactDetailByPurposes"/>
+            <entity-one entity-name="Person" value-field="person"/>
+            <set field="bodyParameters.person" from-field="person"/>
+            <set field="emailParams.bodyParameters" from-field="bodyParameters"/>
+            <set field="contactMechId" from-field="partyContactDetailByPurpose.contactMechId"/>
+            <entity-one entity-name="ContactMech" value-field="contactMech"/>
+            <set field="emailParams.sendTo" from-field="contactMech.infoString"/>
+            <set field="emailParams.subject" from-field="storeEmail.subject"/>
+            <set field="emailParams.sendFrom" from-field="storeEmail.fromAddress"/>
+            <set field="emailParams.sendCc" from-field="storeEmail.ccAddress"/>
+            <set field="emailParams.sendBcc" from-field="storeEmail.bccAddress"/>
+            <set field="emailParams.contentType" from-field="storeEmail.contentType"/>
+            <set field="emailParams.bodyScreenUri" from-field="storeEmail.bodyScreenLocation"/>
+            <set field="emailParams.webSiteId" from-field="webSite.webSiteId"/>
+            <set field="emailParams.emailType" from-field="emailType"/>
+            <call-service service-name="sendMailFromScreen" in-map-name="emailParams"/>
+        </if-not-empty>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=1341341&r1=1341340&r2=1341341&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Tue May 22 08:03:02 2012
@@ -1348,4 +1348,11 @@ under the License.
         <attribute name="emailType" type="String" mode="IN" optional="true"/>
         <attribute name="productStoreId" type="String" mode="IN" optional="true"/>
     </service>
+    
+    <!-- send account activated email notification -->
+    <service name="sendAccountActivatedEmailNotification" engine="simple"
+            location="component://party/script/org/ofbiz/party/party/PartyServices.xml" invoke="sendAccountActivatedEmailNotification" auth="false">
+        <attribute name="userLoginId" type="String" mode="IN" optional="false"/>
+        <attribute name="productStoreId" type="String" mode="IN" optional="false"/>
+    </service>
 </services>

Added: ofbiz/trunk/applications/party/templates/email/AccountActivatedNotification.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/templates/email/AccountActivatedNotification.ftl?rev=1341341&view=auto
==============================================================================
--- ofbiz/trunk/applications/party/templates/email/AccountActivatedNotification.ftl (added)
+++ ofbiz/trunk/applications/party/templates/email/AccountActivatedNotification.ftl Tue May 22 08:03:02 2012
@@ -0,0 +1,30 @@
+<#--
+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">
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <title>${title?if_exists}</title>
+        <link rel="stylesheet" href="${baseUrl?if_exists}/images/maincss.css" type="text/css"/>
+    </head>
+    <body>
+        <h1>${title?if_exists}</h1>
+        <p>Hello ${person.firstName?if_exists} ${person.lastName?if_exists},</p>
+        <p>Your account has been activated.</p>
+    </body>
+</html>

Propchange: ofbiz/trunk/applications/party/templates/email/AccountActivatedNotification.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/party/templates/email/AccountActivatedNotification.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/party/templates/email/AccountActivatedNotification.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/party/widget/partymgr/EmailPartyScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/EmailPartyScreens.xml?rev=1341341&r1=1341340&r2=1341341&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/EmailPartyScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/EmailPartyScreens.xml Tue May 22 08:03:02 2012
@@ -53,4 +53,15 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="AccountActivatedNotification">
+        <section>
+            <actions>
+                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="title" value="${uiLabelMap.PartyNotificationMailActivated}"/>
+            </actions>
+            <widgets>
+                <platform-specific><html><html-template location="component://party/templates/email/AccountActivatedNotification.ftl"/></html></platform-specific>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=1341341&r1=1341340&r2=1341341&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Tue May 22 08:03:02 2012
@@ -121,6 +121,7 @@ under the License.
     <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_CUST_REGISTER" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#CreatePartyNotification" subject="New Account Created" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
     <ProductStoreEmailSetting productStoreId="9000" emailType="UPD_PRSNL_INF_CNFRM" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#ChangePersonalInfoNotification" subject="Personal Information Updated" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
     <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_EMAIL_VERIFY" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#VerifyEmailAddressNotification" subject="Email Address Verification" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
+    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_CUST_ACTIVATED" bodyScreenLocation="component://party/widget/partymgr/EmailPartyScreens.xml#AccountActivatedNotification" subject="Account Activated" bccAddress="ofbiztest@example.com" fromAddress="ofbiztest@example.com"/>
 
     <ProductStoreEmailSetting productStoreId="9000" emailType="CONT_NOTI_EMAIL" bodyScreenLocation="component://ecommerce/widget/EmailContactListScreens.xml#ContactUsEmailNotification" subject="Contact-us Information Notification" fromAddress="ofbiztest@example.com" />
     



Re: svn commit: r1341341 - in /ofbiz/trunk: applications/party/config/ applications/party/data/ applications/party/script/org/ofbiz/party/party/ applications/party/servicedef/ applications/party/templates/email/ applications/party/widget/partymgr/ specialp...

Posted by Hans Bakker <ma...@antwebsystems.com>.
You are right jacopo, corrected in revision 1341344!

On 05/22/2012 03:13 PM, Jacopo Cappellato wrote:
> Hi Hans,
>
> On May 22, 2012, at 10:03 AM, hansbak@apache.org wrote:
>
>> +<set field="productStoreId" from-field="parameters.productStoreId" />
>> +<if-empty field="productStoreId">
>> +<log level="warning" message="No productStoreId specified."/>
>> +</if-empty>
> productStoreId is a mandatory input parameter for the service; the above code is not required.
>
> Regards,
>
> Jacopo
>


Re: svn commit: r1341341 - in /ofbiz/trunk: applications/party/config/ applications/party/data/ applications/party/script/org/ofbiz/party/party/ applications/party/servicedef/ applications/party/templates/email/ applications/party/widget/partymgr/ specialp...

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
Hi Hans,

On May 22, 2012, at 10:03 AM, hansbak@apache.org wrote:

> +        <set field="productStoreId" from-field="parameters.productStoreId" />
> +        <if-empty field="productStoreId">
> +            <log level="warning" message="No productStoreId specified."/>
> +        </if-empty>

productStoreId is a mandatory input parameter for the service; the above code is not required.

Regards,

Jacopo