Scriptor component for Emailing order receipt
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Scriptor component for Emailing order receipt

 
Post new topic   Reply to topic    Windows Server Forum Index -> Commerce Server
Author Message
csstarter
Guest





Posted: Fri Aug 26, 2005 4:52 pm    Post subject: Scriptor component for Emailing order receipt Reply with quote

I wrote this scriptor componnt to mail receipt to the customers onc
they place the order.
Next I added the send mail component to the pipeline and entered th
smtp values and stuff.
When I place an order all i get is a blank email i think its no
capturing the _email_subject and _email_body values from the scripto
component as I did add these fields in the SMTP component.
What is it Iam doing wrong over here..Am I missing an
thing(registering the scriptor component or anything apart fro
this)....
Please help......

function MSCSExecute(config, orderform, context, flags)

Dim dataFunctions
Dim msgBody
Set dataFunctions=context.DataFunctions
orderform.[_email_subject]="Order Confirmation #: " & _
orderform.[orderform_id]
msgBody="Thank you for your order, " & chr(10) & chr(13)
_
"Order id : " &orderform.[orderform_id] & chr(10)
chr(13) & _
"Order Date : "
dataFunctions.Date(orderform.[d_DateLastChanged]) & _
chr(10) & chr(13) & _
"Order Total : " & _
dataFunctions.Money(CLng(orderform.[saved_cy_total_total])) & _
chr(10) & chr(13) & chr(10) & chr(13)
'Loop through shipping addresses
Dim shipments
shipments=orderform.[shipments]

msgBody=msgBody & "Shipping Addresses" & chr(10) & chr(13

for each shipment in shipments
shippingAddressid=shipment.[shipping_address_id]
shippingAddress=orderform.[Addresses].Value(shippingAddressid)
msgBody=msgBody & "Ship by :"
orderform.[shipping_method_name] & _
chr(10) & chr(13)
msgBody=msgBody & shippingAddress.[address_name] & chr(10
& chr(13) & _
shippingAddress.[address_line1] & chr(10) & chr(13)
if Len(shippingAddress.[address2])>0 Then _
msgBody=msgBody & shippingAddress.[address_line2] & chr(10
& chr(13)
msgBody=msgBody & shippingAddress.[city] & " , " & _
shippingAddress.[region_code] & " "
shippingAddress.[postal_code] & _
chr(10) & chr(13) & chr(10) & chr(13)
next
orderform.[_email_body]=msgBody

MSCSExecute = 1
end function

sub MSCSOpen(config)

end sub[/code
Back to top
Nihit Kaul [MSFT]
Guest





Posted: Wed Aug 31, 2005 12:52 am    Post subject: RE: Scriptor component for Emailing order receipt Reply with quote

Did you try check if the values are actually passed in on the context
dictionary?

I am assuming that you have specified these values (_email_subject and
_email_body) on the scriptor component UI in the pipeline editor,

Thanks,

Nihit Kaul[MSFT]
Commerce Server
http://blogs.msdn.com/nihitk

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

--------------------
NNTP-Posting-Date: Fri, 26 Aug 2005 11:43:03 -0500
Subject: Scriptor component for Emailing order receipt
From: rayeesur@gmail-dot-com.no-spam.invalid (csstarter)
Newsgroups: microsoft.public.commerceserver.general
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
User-Agent: newsSync (Commerce Server) 6813
Message-ID: <x_6dnUR6LeAK25LeRVn_vQ@giganews.com>
Date: Fri, 26 Aug 2005 11:43:03 -0500
Lines: 1
X-Trace:
sv3-gRFCQy1wLArZ718L82FcgBxhekN0CT9oYW1t5GZEWgr9mwYO0ERRtuXmeDdbVLn7DDy8+2QF
Gab+kNI!BRiiZ8M/9tRw2Io1gd++bZ+iHq/f319yL7YgptM2Spx6a4kx9RLL99Oq+78R
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
X-Postfilter: 1.3.32
Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!nntp.giganews.com!border1.nntp.dca.gigan
ews.com!local01.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.general:3309
X-Tomcat-NG: microsoft.public.commerceserver.general

I wrote this scriptor componnt to mail receipt to the customers once
they place the order.
Next I added the send mail component to the pipeline and entered the
smtp values and stuff.
When I place an order all i get is a blank email i think its not
capturing the _email_subject and _email_body values from the scriptor
component as I did add these fields in the SMTP component.
What is it Iam doing wrong over here..Am I missing any
thing(registering the scriptor component or anything apart from
this)....
Please help......

function MSCSExecute(config, orderform, context, flags)


Dim dataFunctions
Dim msgBody
Set dataFunctions=context.DataFunctions
orderform.[_email_subject]="Order Confirmation #: " & _
orderform.[orderform_id]
msgBody="Thank you for your order, " & chr(10) & chr(13) &
_
"Order id : " &orderform.[orderform_id] & chr(10) &
chr(13) & _
"Order Date : " &
dataFunctions.Date(orderform.[d_DateLastChanged]) & _
chr(10) & chr(13) & _
"Order Total : " & _
dataFunctions.Money(CLng(orderform.[saved_cy_total_total])) & _
chr(10) & chr(13) & chr(10) & chr(13)
'Loop through shipping addresses
Dim shipments
shipments=orderform.[shipments]

msgBody=msgBody & "Shipping Addresses" & chr(10) & chr(13)

for each shipment in shipments
shippingAddressid=shipment.[shipping_address_id]
shippingAddress=orderform.[Addresses].Value(shippingAddressid)
msgBody=msgBody & "Ship by :" &
orderform.[shipping_method_name] & _
chr(10) & chr(13)
msgBody=msgBody & shippingAddress.[address_name] & chr(10)
& chr(13) & _
shippingAddress.[address_line1] & chr(10) & chr(13)
if Len(shippingAddress.[address2])>0 Then _
msgBody=msgBody & shippingAddress.[address_line2] & chr(10)
& chr(13)
msgBody=msgBody & shippingAddress.[city] & " , " & _
shippingAddress.[region_code] & " " &
shippingAddress.[postal_code] & _
chr(10) & chr(13) & chr(10) & chr(13)
next
orderform.[_email_body]=msgBody

MSCSExecute = 1
end function

sub MSCSOpen(config)

end sub[/code]
Back to top
csstarter
Guest





Posted: Wed Aug 31, 2005 8:53 am    Post subject: re:Scriptor component for Emailing order receipt Reply with quote

I appreciate ur reply..
I thought I was building _email_subject and _email_body in th
scriptor component and sending it to SendSMTP component .I will b
creating these values in the scriptor component and grabbing them an
using them in SMTP component.I do have entered the values o
_email_subject and _email_msg in the UI for SendSmtp component
How do i add it to the context if Iam creating those values i
scriptor component...
bear with me as I am just a newbie to this..
Back to top
csstarter
Guest





Posted: Thu Sep 01, 2005 4:52 pm    Post subject: re:Scriptor component for Emailing order receipt Reply with quote

Commerce.Scriptor .1.Mscs.Execute() failed.Script invocatio
failed>Object Required context.dataFunctions Line 7...et
I get this error after I pass the values and run the scripto
component..
how do i define the context for DataFunctions...Could anyone help m
on this plzzzz
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Commerce Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB