Hello
I am explaining in detail what i want to do and what i have done .
I have restricted the user from login immediately after he/she gets
registered on a ecommerce website. This i have done by setting " Require
customer role = N " of that particular webstore.
This restricts user from login immediately after getting registered though
he/she has password and the control will redirect to login page.
So the issue is :
We have to go to webtools part of ofbiz . CATALOG ---> Stores ---->
choose the particular webstore and click on it.
Then we go to roles and a form will open . In that i choose "Role type =
Customer " , partyID and date.
This will approve that particular user.
The problem is that according to client requirement, We have to send
mail at this time to the email id of that user . Mail content is " your
account has been approved ".
EditProductStoreRoles.ftl , ProductStoreServices.xml and
ProductStoreWorker.java and also controller.xml deals with all that.
we have added following code in ProductStoreServices.xml .Please see in
the end .
<simple-method method-name="createProductStore"
short-description="Create a Product Store">
<check-permission permission="CATALOG"
action="_CREATE"><fail-message message="Security Error: to run
createProductStore you must have the CATALOG_CREATE or CATALOG_ADMIN
permission"/></check-permission>
<check-errors/>
<if-compare field-name="parameters.showPricesWithVatTax"
operator="equals" value="Y">
<if-empty field-name="parameters.vatTaxAuthGeoId" >
<add-error><fail-property property="VatTaxAuthGeoNotSet"
resource="CommonUiLabels"/></add-error>
</if-empty>
<if-empty field-name="parameters.vatTaxAuthPartyId" >
<add-error><fail-property property="VatTaxAuthPartyNotSet"
resource="CommonUiLabels"/></add-error>
</if-empty>
<check-errors/>
</if-compare>
<make-value value-name="newEntity" entity-name="ProductStore"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<sequenced-id-to-env sequence-name="ProductStore"
env-name="productStoreId" />
<set from-field="productStoreId" field="newEntity.productStoreId"/>
<field-to-result field-name="productStoreId"
result-name="productStoreId"/>
<create-value value-name="newEntity"/>
<!-- create the ProductStoreFacility record -->
<now-timestamp-to-env env-name="nowTimestamp"/>
<if-not-empty field-name="inventoryFacilityId" map-name="newEntity">
<make-value value-name="storeFacility"
entity-name="ProductStoreFacility"/>
<set from-field="newEntity.inventoryFacilityId"
field="storeFacility.facilityId"/>
<set from-field="newEntity.productStoreId"
field="storeFacility.productStoreId"/>
<set from-field="nowTimestamp" field="storeFacility.fromDate"/>
<create-value value-name="storeFacility"/>
</if-not-empty>
/* this line we have added */ <call-class-method method-name="sendMail"
class-name="org.ofbiz.product.store.ProductStoreWorker">
</call-class-method>
</simple-method>
After that :
We have defined a method in ProductStoreWorker.java called
public void sendMail()
{
// code to send mail.
}
It handles sending of mail . But we r not able to find out how i get
partyId value into that method which is key value that handles everything.
Please tell what enteries I will make in in createProductStore method of
ProductStoreServices.xml so that i will receive partyId in java file's
method.
Thanks in advance.
Prateek
Voltix Softwares Pvt .Ltd
India
--
View this message in context:
http://www.nabble.com/Problem-in-Mail-sending-%3Acheck-details-tf4611739.html#a13170010
Sent from the OFBiz - User mailing list archive at Nabble.com.