close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

issue of email placement in code

Thread began 4/30/2012 4:05 pm by Christopher West | Last modified 5/02/2012 12:47 pm by Jason Byrnes | 584 views | 5 replies |

Christopher WestCommunity Expert

issue of email placement in code

Hello.

I got a page that on update sends an email to a customer to tell them of their order progress. I had to place the email code inside the repeat region though since it was the only way to link the customer email with the email "TO" email reference in the email server behaviour - this all works...except then email is ONLY sent out on the "next page update" and then it only sends out the previous email and not the current email that the admin is clicking to update (if that at all makes any sense to how I wrote it :)

attaching code to see if you can help :)

Chris

Attached Files
open-orders.zip
Sign in to reply to this post

Jason ByrnesWebAssist

1) the email code should not be in the repeat region, it should be left before the doctype tag.


2) In the Universal Email wizard, click the To button to set the to address to use a recordset loop.

3) The order of the code will need to be changed slightly. right now, the code for the rsOpenOrders recordset is before the update record code block, you will need to rearrange this so it is after the update record code block, but before the Universal email code block.


the code order should be:
update record
rsOpenOrders recordset
Universal Email

Sign in to reply to this post

Christopher WestCommunity Expert

thank you :) perfect its sorted :) i just need to amend it slightly now as the last process in the update is "shipped" but i have coded it so that when the record gets updated to "shipped" it gets removed from the open-orders page and gets displayed in the closed-orders page but for some reason the email doesnt get sent to the customer to say its shipped - so im assumning that the update happens, the record disappears so there is nothing for the universal email behaviour to send. hmmmm :-\

Sign in to reply to this post

Jason ByrnesWebAssist

well, the recordset your are using for the email is:

SELECT * FROM orders WHERE OrderStatus = 1 AND OrderProcess != 'Shipped'"


you would need to use a diferant recordset for sending the email:
SELECT * FROM orders WHERE OrderStatus = 1

Sign in to reply to this post

Christopher WestCommunity Expert

another issue im having with this page - im getting the emails but for some reason its sending duplicate emails (I think its sending a 1 duplicate email to the amount of how many records are on the page - so for example I have 6 customer records and its sending the same email 6 times to the same customer email address). here is the page in question.

I hope its a simple fix :)

Chris

Attached Files
open-orders.zip
Sign in to reply to this post

Jason ByrnesWebAssist

in the To Address settings screen, try increasing the Wait setting. some SMTP servers send duplicate emails if too many are sent at a time.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...