Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

URGENT-Email Query

Posted on 2003-11-29
15
Medium Priority
?
221 Views
Last Modified: 2010-04-01
hi,

i have a form called users.jsp  and displayusers.jsp.

A user would use users.jsp to register and if the info is correct,it would take user to displayusers.jsp that displays the info.In the displayusers.jsp, there is the email code that sends the confirmation message.

For eg,
Skillid  skill
1        Teacher
2        Doctor

projectid  skill
1              1
2              1
2               2

and etc,

users table
users info...

usersskill table
userid    skill
u1           1
u1           2
and etc


Lets say teh user register info and if the skill required matches the skill needed, confirmation message is sent to the user, the problem is that whenever the user is logged in, she would be directed to displays.jsp.So, the email confirmation is sent again.

I mean how do i do , that if teh confirmation email is sent already, it need not to be sent.

thanks
0
Comment
Question by:Jasbir21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 3
  • +1
15 Comments
 
LVL 15

Assisted Solution

by:jimmack
jimmack earned 200 total points
ID: 9842186
If users.jsp is only used for registration, then instead of sending the e-mail in the displayusers.jsp, create a servlet to send the e-mail and when this is done, redirect (or forward) to the displayusers.jsp.

This way, you separate the logic of confirming the registration from the display of the user information.
0
 

Expert Comment

by:srmani
ID: 9842291
As I understand your users.jsp.  It should handle the two cases, new user registration and existing user login.  And finally after processing any of the above cases, should redirect to the displayusers.jsp.
Use any request parameter alongwith the request uri during the redirection, so that in the displayuser.jsp, you can send the confirmation message based on the value of this request parameter.  Alternatively you can also think about putting a state in session too.

Another neat way, I would suggest is to redirect the user back to the loggin page after the registration is complete and successfull.  Embed your confirmation message code in the users.jsp itself.  After registration, prompt for a login and then uniformly handle the login to the displayusers.jsp page.

Hope this helps...!
0
 

Author Comment

by:Jasbir21
ID: 9843782
hi,
 my problem is that:

I mean how do i do , that if teh confirmation email is sent already, it need not to be sent
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 15

Expert Comment

by:jimmack
ID: 9843793
Could you store a flag or something in a cookie?
0
 
LVL 92

Expert Comment

by:objects
ID: 9843900
send your confirm email from a seperate page, and then redirect to your display page.
that way the confirm email is only sent after registration.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9843914
As I originally said ;-)
0
 
LVL 92

Expert Comment

by:objects
ID: 9843939
Sorry, saw your second post and didn't read your first.

Thinking about it some more, it would seem there would be code somewhere that performs the registration. Why don't you send the email from that code.
0
 

Author Comment

by:Jasbir21
ID: 9844336
hi,
  Sorry,it was mistake that i might confuse things.

28 th November
The users use this form to register their skils as :Teacher,Nurse,

Organization:
Project
1          Teacher
2           Teacher
3           Nurse        30thNovember


Currently, there is no organization that needs the skill for Nurse but on 30th November, a new project is registered by organization x or new project by same organization.
So, then email need to ssent.but for project 1,2 email already sent

Thanks



0
 
LVL 92

Expert Comment

by:objects
ID: 9844348
So when exactly does an email need to be sent?
0
 

Author Comment

by:Jasbir21
ID: 9844372
Previously, when ever user register, he go directed to display page,so email sent.
Or when user logs-in, he needs to be directed to display page (by default), so if any skills added, email sent .



But problem is email get resent.

0
 
LVL 92

Expert Comment

by:objects
ID: 9844376
The display page should not be sending the emails.
Sending emails should be handled by a seperate page which is only loaded when emails need to be sent.
0
 

Author Comment

by:Jasbir21
ID: 9844385
ok, i  changing to different page,but i don't understand something. How does the page only gets loaded why email need to sent.I mean, how could i tell, for this skill that earlier register email sent, if new skill needed and email not yet sent for that particular skill and for that project, than send email


thanks
0
 
LVL 92

Accepted Solution

by:
objects earned 220 total points
ID: 9844397
If you don't have the necessary information to make tht decision then you will need to store. eg. store who has been sent emails in the database.
0
 

Author Comment

by:Jasbir21
ID: 9844764
ok, i think i understand , thank you .
0
 
LVL 92

Expert Comment

by:objects
ID: 9846490
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question