| Author |
Topic |
|
kirkeby
Yak Posting Veteran
57 Posts |
Posted - 2002-08-29 : 11:44:33
|
Please don't laugh too hard when you read this. Currently, we have the SQL server send out an email with a link to a survey once a request has been completed. Instead of having a link in the email to a survey, is there any way at all to have voting buttons in the email? This would eliminate having the recipient have to go to another place to answer three questions. I know, there are no parameters for voting buttons. Could you, possibly, have an attachment to the email that was an .asp page with 3 questions on it, plus comments, that posted the results back to the database? Am I asking for too much here? If not, we'll just track the stuff manually. Thanks for any input from anyone.Lisa KirkebyBPkirkeblm@bp.comSQL 7.0, NT 4.0 (1381), CP 1252 |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2002-08-29 : 12:02:05
|
| What you would need is an ASP page that takes parameters in the URL.Like this:myvotepage.asp?vote=yes&userid=michaelpIn your email, have links to the "yes" vote and the "no" vote.You could also just send them a link to the ASP page, and the ASP page has buttons that do a POST to submit the vote in.BTW, "attaching" an ASP page to the email would not work because ASP must be run at the server. if you attached it, they'd just see your code. You must send a link to the ASP pageMichael<Yoda>Use the Search page you must. Find the answer you will.</Yoda> |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-08-29 : 12:05:41
|
It would be a lot easier to create an HTML formatted email that contained the votes as check boxes or drop downs, and add a submit button. That submit button would redirect to an ASP page with the survey like you have now. You get the best of both worlds in a way.You can't attach an ASP page because it needs to run on a web server; the user would open it and not much would happen. Sending it back as an attachment won't work either.IMHO using the link like you have now is probably best, because you can set up a more dynamic survey using the same ASP page. Trying to create HTML emails with SQL Mail is a pain too. With a little tiny bit of work you can make all of the surveys database driven. Edited by - robvolk on 08/29/2002 12:06:12 |
 |
|
|
kirkeby
Yak Posting Veteran
57 Posts |
Posted - 2002-08-29 : 12:09:37
|
| Thank you both, very much, for your responses! I believe I will try the HTML email.Lisa KirkebyBPkirkeblm@bp.comSQL 7.0, NT 4.0 (1381), CP 1252 |
 |
|
|
kirkeby
Yak Posting Veteran
57 Posts |
Posted - 2002-08-29 : 12:27:00
|
| Robert,Is there any way you can send HTML formatted email using xp_sendmail? I don't think you can. Looks as though I'll lose some automation no matter what I decide to do. Thanks!Wait. Could you not set up a Job on the SQL server that had a step that ran a procedure to check for all newly completed requests, then had the next step run a script file that sent the email to those request numbers, and then to process as you stated (collecting the responses and then posting back to the database)? If so, how would you pass the request numbers from step 1 to step 2?Lisa KirkebyBPkirkeblm@bp.comSQL 7.0, NT 4.0 (1381), CP 1252 |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-08-29 : 12:46:12
|
| Ooooops. I realized just as I hit the "Post New Reply" button that xp_sendmail and HTML mail don't mix. I *thought* someone had found a way to do it, but you'll have to search the SQL Team forums, and I think the solution is so unwieldly it's not worth it.However, if you are generating requests, they probably have request/ID numbers. You can pass these into the URL in a plain-text email, like Michael stated earlier:http://www.mysite.com/survey.asp?requestid=12345The user would click on that link and the ASP page would receive the "requestid" variable with a value of 12345, or whatever value matches that request ID. From there, the ASP code would generate the survey questions and add a submit button, and the survey works as a regular ASP page. You would include an HTML form control like this:<input type=hidden name=requestid value="<%= request("requestid")%>">That will allow the request ID that was originally passed to the survey page to be passed again to the ASP page that accepts the votes.Edited by - robvolk on 08/29/2002 12:47:22 |
 |
|
|
Onamuji
Aged Yak Warrior
504 Posts |
Posted - 2002-08-29 : 12:51:47
|
I wrote my own MAPI component that hooks up to an EXCHANGE mail box and sends emails ... if you can dig through the slim documentation on EXCHANGE programming SDK you may find a way to send those voting buttons that way ... i found out after a lot of gruesome digging how to send a TASK EMAIL from within SQL SERVER So I'm sure you can do the button thing just depends on your time frame and if you want to do the work or not |
 |
|
|
kirkeby
Yak Posting Veteran
57 Posts |
Posted - 2002-08-29 : 13:00:03
|
| Onamuji,What's a TASK EMAIL? What exactly does the MAPI you wrote do? Do you have a job on your SQL server that invokes a routine that uses it?Robert,My boss wants to eliminate our customers from having to click on a link to take them to a survey...that's how we're doing it now and they simply won't take the time. She thought that perhaps they would be more inclined to comply if the email contained the voting buttons. What about my suggestion of setting up a job on the SQL server to check for newly completed requests and then launch a script file which would send the HTML email and then post the results back to the database? Feasible?Again, thanks everyone for your continued interest!Lisa KirkebyBPkirkeblm@bp.comSQL 7.0, NT 4.0 (1381), CP 1252 |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-08-29 : 13:09:28
|
quote: What about my suggestion of setting up a job on the SQL server to check for newly completed requests and then launch a script file which would send the HTML email and then post the results back to the database? Feasible?
The job can be set up to send HTML formatted emails, as long as it doesn't use SQL Mail/xp_sendmail. There are a couple of articles on SQL Team about sending mail by other means. The HTML form can't be sent back as an email response. And even if it was, you'd have to parse out the responses instead of handling them as a regular HTML form. The form has to be submitted to an HTTP server/ASP page to receive the responses and process them. At best, the HTML email lets you use only one link instead of two; although that would be a big improvement, AFAIK there's no practical way to completely eliminate an HTTP step. |
 |
|
|
Onamuji
Aged Yak Warrior
504 Posts |
Posted - 2002-08-29 : 14:43:52
|
| my code just sends emails or tasks to people internally ... since tasks are mainly an outlook/exchange thing and so is the voting buttons ... I would not suggest you send it that way... search on the site for sending html like rob suggested ... then send it that way... |
 |
|
|
|